Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4527431

URL get() methods need descriptive comments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P5 P5
    • None
    • 1.4.0
    • core-libs
    • generic
    • solaris_2.6

      Experimentation shows what the methods return, but the API comments could
      provide the needed information. To wit:

      Given URL url = new URL("http://foo/bar/baz.html");

      url.getRef() => null
      url.getPath() => /bar/baz.html
      url.getFile() => /bar/baz.html
      url.getProtocol() => http
      url.getPort() => -1
      url.getAuthority() => foo
      url.toExternalForm() => http://foo/bar/baz.html

      The comments currently say nothing. The getPath() method, for instance, says
      "returns the path part of the URL", but that comment does nothing to help the
      user understand what the path part *is*.

            michaelm Michael McMahon
            earmstrosunw Eric Armstrong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: