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

InetAddress.getByName/getAllByName should clarify empty String behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 11
    • 7, 11
    • core-libs
    • b12
    • Verified

      InetAddress.getByName/getAllByName is specified to return an InetAddress instance that "refers to any of the local machine's available network addresses", when passed a `null` host String. The spec is silent on the behavior when an empty string is passed. The spec should be update to include the behavior for an empty string ( same as for null ).

      Strangely getAllByName does have some reference to an empty string in its paragraph regarding security manager, "If there is a security manager and {@code host} is not null and {@code host.length() } is not equal to zero, the security manager's ..."

      This issue has been filed as a result of a query posted to core-libs-dev:
      http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-April/052598.html

            chegar Chris Hegarty
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: