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

DOC: java.net.URL methods documentation doesn't specify null vs. empty strings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • docs
    • beta3
    • generic
    • generic



      Name: rmT116609 Date: 08/02/2001


      J2SE 1.3.1 documentation

      In the documentation for java.net.URL, many method descriptions fail to
      specify whether the methods return null or empty strings.

      For example, the getQuery() description says:

        public String getQuery()

           Returns the query part of this URL.
           Returns:
                the query part of this URL.

      Specifically, it doesn't say what is returned if the URL contains no
      query string.

      In this case, one can figure out that getQuery() had better return null
      to indicate the lack of a query string, so that case can be distinguished
      from having a query string that is empty, but this still should be
      documented.

      It also happens in the following methods:

      getPath()

      getUserInfo()

      getAuthority()

      getProtocol()

      getHost()

      getFile()

      getRef()

      (Review ID: 129288)
      ======================================================================

            shommel Scott Hommel (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: