Skip to content

Commit cb7c1d5

Browse files
committed
Feedback from CSR review
1 parent fe9c3a8 commit cb7c1d5

File tree

1 file changed

+22
-30
lines changed

1 file changed

+22
-30
lines changed

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

+22-30
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@
6262
* Network interface instances are typically used to identify the local
6363
* interface on which a multicast group is joined.
6464
*
65+
* @apiNote <a id="lookup"></a>Several static methods in this class allow to
66+
* lookup and return new instances of {@code NetworkInterface}.
67+
* As outlined above, the returned interface instances may reflect a snapshot
68+
* of the configuration taken at the time the instance is created.
69+
* The network configuration may change at any time, and such methods may need to
70+
* be invoked again in order to obtain a more up-to-date view of the network
71+
* interfaces.
72+
* In particular, there is no guarantee that the same interface will be
73+
* found at the same index, or that the same network addresses will be
74+
* bound to the interface, if the network configuration of the system
75+
* has changed.
76+
*
6577
* @since 1.4
6678
*/
6779
public final class NetworkInterface {
@@ -282,12 +294,8 @@ public String getDisplayName() {
282294
* @apiNote
283295
* The returned interface instance may reflect a snapshot of the
284296
* configuration taken at the time the instance is created.
285-
* The network configuration may change at any time, and this method may need to
286-
* be invoked again to obtain a more up-to-date view of the network interface.
287-
* In particular, there is no guarantee that the same interface will be
288-
* found at the same index, or that the same network addresses will be
289-
* bound to the interface, if the network configuration of the system
290-
* has changed.
297+
* See the general discussion of {@linkplain NetworkInterface##lookup
298+
* snapshots and configuration} for the semantics of the returned interface.
291299
*
292300
* @param name
293301
* The name of the network interface.
@@ -314,12 +322,8 @@ public static NetworkInterface getByName(String name) throws SocketException {
314322
* @apiNote
315323
* The returned interface instance may reflect a snapshot of the
316324
* configuration taken at the time the instance is created.
317-
* The network configuration may change at any time, and this method may need to
318-
* be invoked again to obtain a more up-to-date view of the network interface.
319-
* In particular, there is no guarantee that the same interface will be
320-
* found at the same index, or that the same network addresses will be
321-
* bound to the interface, if the network configuration of the system
322-
* has changed.
325+
* See the general discussion of {@linkplain NetworkInterface##lookup
326+
* snapshots and configuration} for the semantics of the returned interface.
323327
*
324328
* @param index an integer, the index of the interface
325329
* @return the NetworkInterface obtained from its index, or {@code null} if
@@ -347,12 +351,8 @@ public static NetworkInterface getByIndex(int index) throws SocketException {
347351
* @apiNote
348352
* The returned interface instance may reflect a snapshot of the
349353
* configuration taken at the time the instance is created.
350-
* The network configuration may change at any time, and this method may need to
351-
* be invoked again to obtain a more up-to-date view of the network interface.
352-
* In particular, there is no guarantee that the same interface will be
353-
* found at the same index, or that the same network addresses will be
354-
* bound to the interface, if the network configuration of the system
355-
* has changed.
354+
* See the general discussion of {@linkplain NetworkInterface##lookup
355+
* snapshots and configuration} for the semantics of the returned interface.
356356
*
357357
* @param addr
358358
* The {@code InetAddress} to search with.
@@ -400,12 +400,8 @@ public static NetworkInterface getByInetAddress(InetAddress addr) throws SocketE
400400
* <p>
401401
* The returned interface instances may reflect a snapshot of the
402402
* configuration taken at the time the instance is created.
403-
* The network configuration may change at any time, and this method may need to
404-
* be invoked again to obtain a more up-to-date view of the network interfaces.
405-
* In particular, there is no guarantee that the same interface will be
406-
* found at the same index, or that the same network addresses will be
407-
* bound to the interface, if the network configuration of the system
408-
* has changed.
403+
* See the general discussion of {@linkplain NetworkInterface##lookup
404+
* snapshots and configuration} for the semantics of the returned interface.
409405
*
410406
* @return an Enumeration of NetworkInterfaces found on this machine
411407
* @throws SocketException if an I/O error occurs,
@@ -439,12 +435,8 @@ public static Enumeration<NetworkInterface> getNetworkInterfaces()
439435
* <p>
440436
* The returned interface instances may reflect a snapshot of the
441437
* configuration taken at the time the instance is created.
442-
* The network configuration may change at any time, and this method may need to
443-
* be invoked again to obtain a more up-to-date view of the network interfaces.
444-
* In particular, there is no guarantee that the same interface will be
445-
* found at the same index, or that the same network addresses will be
446-
* bound to the interface, if the network configuration of the system
447-
* has changed.
438+
* See the general discussion of {@linkplain NetworkInterface##lookup
439+
* snapshots and configuration} for the semantics of the returned interface.
448440
*
449441
* @return a Stream of NetworkInterfaces found on this machine
450442
* @throws SocketException if an I/O error occurs,

0 commit comments

Comments
 (0)