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

Spec Clarification - InterfaceAddress:getBroadcast() returning null for loop back address

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 26
    • core-libs
    • None
    • minimal
    • This is a documentation change only. No behaviour change.
    • Java API
    • SE

      Summary

      InterfaceAddress::getBroadcast API documentation is updated to not mention the loopback interface

      Problem

      The current API documentation may let the reader assume that getBroadcast() will always return null for the loopback interface. This is not the case on all systems.

      Solution

      Remove mention of the loopback interface and simplify the documentation to simply say:

           * Some network interfaces do not support broadcasting and may
           * also return {@code null}.

      Specification

      diff --git a/src/java.base/share/classes/java/net/InterfaceAddress.java b/src/java.base/share/classes/java/net/InterfaceAddress.java
      index 6df2de353e3..44b3456c6fc 100644
      --- a/src/java.base/share/classes/java/net/InterfaceAddress.java
      +++ b/src/java.base/share/classes/java/net/InterfaceAddress.java
      @@ -63,8 +63,8 @@ public InetAddress getAddress() {
            * Only IPv4 networks have broadcast address therefore, in the case
            * of an IPv6 network, {@code null} will be returned.
            * <p>
      -     * Certain network interfaces, such as the loopback interface, do not support
      -     * broadcasting and will also return {@code null}.
      +     * Some network interfaces do not support broadcasting and may
      +     * also return {@code null}.
            *
            * @return the {@code InetAddress} representing the broadcast
            *         address or {@code null} if there is no broadcast address.

            dfuchs Daniel Fuchs
            kganapureddy Krushnareddy Ganapureddy
            Daniel Jelinski, Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: