Summary
Adjust the specification of the java.net.NetworkInterface methods getInetAddresses, inetAddresses and getInterfaceAddresses to reflect changes post JEP-468
Problem
These methods in NetworkInterface has historically filtered their results to remove entries which does not pass the SecurityManager::checkConnect method. JEP-486 removed any references to SecurityManager for these methods, but left out updating the "with all, or a subset of" part of the method descriptions.
Since there is no SecurityManager filtering anymore, these methods should simply say what they return.
Solution
- Remove "with all, or a subset.." from NetworkInterface.getInetAddresses, NetworkInterface.inetAddresses and NetworkInterface.getInterfaceAddresses method descriptions
- Update the '@return' text for these methods accordingly
Specification
Here's a patch for the Javadoc changes:
diff --git a/src/java.base/share/classes/java/net/NetworkInterface.java b/src/java.base/share/classes/java/net/NetworkInterface.java
index 1c5edd1c23f..0a8f66827f3 100644
--- a/src/java.base/share/classes/java/net/NetworkInterface.java
+++ b/src/java.base/share/classes/java/net/NetworkInterface.java
@@ -118,16 +118,15 @@ public String getName() {
}
/**
- * Get an Enumeration with all, or a subset, of the InetAddresses bound to
- * this network interface.
+ * Get an Enumeration of the InetAddresses bound to this network interface.
*
* @implNote
- * The returned enumeration contains all, or a subset, of the InetAddresses that were
- * bound to the interface at the time the {@linkplain #getNetworkInterfaces()
+ * The returned enumeration contains the InetAddresses that were bound to
+ * the interface at the time the {@linkplain #getNetworkInterfaces()
* interface configuration was read}
*
- * @return an Enumeration object with all, or a subset, of the InetAddresses
- * bound to this network interface
+ * @return an Enumeration object with the InetAddresses bound to this
+ * network interface
* @see #inetAddresses()
*/
public Enumeration<InetAddress> getInetAddresses() {
@@ -135,16 +134,14 @@ public String getName() {
}
/**
- * Get a Stream of all, or a subset, of the InetAddresses bound to this
- * network interface.
+ * Get a Stream of the InetAddresses bound to this network interface.
*
* @implNote
- * The stream contains all, or a subset, of the InetAddresses that were
- * bound to the interface at the time the {@linkplain #getNetworkInterfaces()
+ * The stream contains the InetAddresses that were bound to the
+ * interface at the time the {@linkplain #getNetworkInterfaces()
* interface configuration was read}
*
- * @return a Stream object with all, or a subset, of the InetAddresses
- * bound to this network interface
+ * @return a Stream object with the InetAddresses bound to this network interface
* @since 9
*/
public Stream<InetAddress> inetAddresses() {
@@ -177,11 +174,11 @@ public String getName() {
}
/**
- * Get a List of all, or a subset, of the {@code InterfaceAddresses}
- * of this network interface.
+ * Get a List of the {@code InterfaceAddresses} of this network interface.
+ *
+ * @return a {@code List} object with the InterfaceAddress of this
+ * network interface
*
- * @return a {@code List} object with all, or a subset, of the
- * InterfaceAddress of this network interface
* @since 1.6
*/
public java.util.List<InterfaceAddress> getInterfaceAddresses() {
- csr of
-
JDK-8344218 Remove calls to SecurityManager and and doPrivileged in java.net.NetworkInterface after JEP 486 integration
-
- Resolved
-