Skip to content

Commit a8d8ffa

Browse files
kieran-farrelldfuch
authored andcommitted
8356395: Spec needs to be clarified for InterfaceAddress class level API documentation and getBroadcast() method
Reviewed-by: dfuchs
1 parent f6b0f01 commit a8d8ffa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/java.base/share/classes/java/net/InterfaceAddress.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
import java.util.Objects;
2929

3030
/**
31-
* This class represents a Network Interface address. In short it's an
32-
* IP address, a subnet mask and a broadcast address when the address is
33-
* an IPv4 one. An IP address and a network prefix length in the case
34-
* of IPv6 address.
31+
* This class represents a Network Interface address. In the case of
32+
* IPv4, this comprises the IP address, a subnet mask, and a broadcast
33+
* address if the interface supports broadcast. In the case of IPv6,
34+
* it comprises the IP address and a network prefix length.
3535
*
3636
* @see java.net.NetworkInterface
3737
* @since 1.6
@@ -62,6 +62,9 @@ public InetAddress getAddress() {
6262
* <p>
6363
* Only IPv4 networks have broadcast address therefore, in the case
6464
* of an IPv6 network, {@code null} will be returned.
65+
* <p>
66+
* Certain network interfaces, such as the loopback interface, do not support
67+
* broadcasting and will also return {@code null}.
6568
*
6669
* @return the {@code InetAddress} representing the broadcast
6770
* address or {@code null} if there is no broadcast address.

0 commit comments

Comments
 (0)