-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8283779: Clarify API documentation of NetworkInterface with respect to configuration changes #20822
Conversation
/issue JDK-8283779 |
👋 Welcome back dfuchs! A progress list of the required criteria for merging this PR into |
@dfuch This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 78 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@dfuch This issue is referenced in the PR title - it will now be updated. |
Webrevs
|
Also, I think it would be useful and helpful to allude to the "snapshot" characteristics of a NetworkInterface instance in the opening description of the class public final class NetworkInterface Add to this description, some explanation to the fact that an instance of a NetworkInterface is reflective of its configuration at the time it was created, and that it is possible for that configuration to change due to dynamic reconfiguration policies within a host environment i.e. your "snapshot" details. These additions of implNote and apiNote to various methods will be helpful |
* @implNote | ||
* The returned array contains all or a subset of the InetAddresses that were | ||
* bound to the interface at the time the {@linkplain #getNetworkInterfaces() | ||
* interface configuration was read} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have a typo here in that this method returns an Enumeration rather than an array.
* @apiNote | ||
* The returned interface instance may reflect a snapshot of the | ||
* configuration taken at the time the instance is created. | ||
* To see updates to the configuration may, or may not, require |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence "To see updates ..." is hard to read. How about "The network configuration may change at any time, this method may need to be invoked to obtain a more up to date view of the network interface".
Co-authored-by: Daniel Jelinski <djelinski1@gmail.com>
Co-authored-by: Daniel Jelinski <djelinski1@gmail.com>
/csr needed |
I'll create a CSR once we have converged on the wording. |
@dfuch has indicated that a compatibility and specification (CSR) request is needed for this pull request. @dfuch please create a CSR request for issue JDK-8283779 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@@ -97,6 +117,11 @@ public String getName() { | |||
* {@link NetPermission}("getNetworkInformation") permission, then all | |||
* InetAddresses are returned. | |||
* | |||
* @implNote | |||
* The returned enumeration contains all or a subset of the InetAddresses that were |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps additional comma for emphasis
The returned enumeration contains all, or a subset, of the InetAddresses . . .
@@ -116,6 +141,11 @@ public Enumeration<InetAddress> getInetAddresses() { | |||
* {@link NetPermission}("getNetworkInformation") permission, then all | |||
* InetAddresses are returned. | |||
* | |||
* @implNote | |||
* The stream contains all or a subset of the InetAddresses that were |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps additional comma for emphasis
The stream contains all, or a subset, of the InetAddresses . . .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are good additions and help re-enforce the current apiNote on the equals method and help bring into focus the transient and dynamic nature of NetworkInterface configurations in contemporary network environments.
I have drafted the CSR here: JDK-8339623 - Reviewers are welcome! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW . . . LGTM
I pushed a change that implement feedback received during CSR review. @AlanBateman still good to go? |
* looking up a network interface again in order to obtain a new instance. | ||
* <p> | ||
* Network interface instances are typically used to identify the local | ||
* interface on which a multicast group is joined. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several static methods in this class are factory methods, returning a new instance of a NetworkInterface, reflecting the configuration at the time of instantiation. The network configuration may change at any time, for example DCHP lease renewal , or IPv6 aoutconfig. As such, these methods may need to be invoked again, to obtain a more up-to-date view of the network interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factory methods sounds good. Not sure we want to list what could cause the configuration to change: for virtual interfaces created by software components it could be just anything. I'll borrow part of your text and update.
/integrate |
Going to push as commit c8e64cb.
Your commit was automatically rebased without conflicts. |
Please find here a change that adds a few
@apiNote
and@implNote
toNetworkInterface
to clarify user expectation and implementation.Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20822/head:pull/20822
$ git checkout pull/20822
Update a local copy of the PR:
$ git checkout pull/20822
$ git pull https://git.openjdk.org/jdk.git pull/20822/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20822
View PR using the GUI difftool:
$ git pr show -t 20822
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20822.diff
Webrev
Link to Webrev Comment