-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8329745: Update the documentation of ServerSocket and Socket to refer to StandardSocketOptions instead of legacy SocketOptions #18646
Conversation
… to StandardSocketOptions instead of legacy SocketOptions
👋 Welcome back jpai! A progress list of the required criteria for merging this PR into |
@jaikiran 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 48 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 |
Webrevs
|
* <p> | ||
* The behaviour when {@link SocketOptions#SO_REUSEADDR SO_REUSEADDR} is | ||
* The behaviour when {@link StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} is |
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 suppose the main question here is whether the description really needs to link to SO_REUSEADDR five times, it seems a bit excessive. In cases like this I tend to just have the first usage link, others do it differently.
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.
Hello Alan, I too typically follow the process of linking once and then using {@code SO_REUSEADDR}
. I let it stay in this form since it was already that way. I'll go ahead and update it to link only once.
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.
Done - I've updated the PR to remove the repeated links.
@@ -261,7 +261,7 @@ public ServerSocket(int port, int backlog) throws IOException { | |||
* the specified range of valid port values, which is between | |||
* 0 and 65535, inclusive. | |||
* | |||
* @see SocketOptions | |||
* @see StandardSocketOptions |
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.
What would you think about dropping this link, and the link to SocketImpl from all the constructors, they aren't relevant for anyone reading this part of the docs.
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 constructors talk about the {@code createSocketImpl} method
, so I'm guessing the @see java.net.SocketImpl
was meant to provide reference to the SocketImpl
. But I think we should just change the {@code createSocketImpl} method
to {@link SocketImplFactory#createSocketImpl()} method
and remove these @see java.net.SocketImpl
.
I guess we could do the same and remove the @see java.net.SocketImpl
from the constructors of java.net.Socket
too?
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've now updated the PR with what I had in mind for this proposed change to these constructors.
* create the actual socket implementation. Otherwise a system-default | ||
* factory, that {@linkplain SocketImplFactory#createSocketImpl() | ||
* factory's createSocketImpl method} is called to create | ||
* the actual socket implementation. Otherwise a system-default |
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 this would be better if you link "server socket implementation factory" to SocketImplFactory, and link "createSocketImpl" to the createSocketImpl method.
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.
Done - I've updated the PR with these changes to both ServerSocket and Socket class.
@@ -173,7 +173,8 @@ private Socket(Void unused, SocketImpl impl) { | |||
* Creates an unconnected Socket. | |||
* <p> | |||
* If the application has specified a client socket implementation | |||
* factory, that factory's {@code createSocketImpl} method is called to | |||
* factory, that {@linkplain SocketImplFactory#createSocketImpl() | |||
* factory's createSocketImpl method} is called to |
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.
Same comment as ServerSocket.
@jaikiran the only reservation I have is that the new wording makes it look like the default implementation of |
I think the proposal is okay. It just specifies that set/gets the socket options, it doesn't specify whether it calls the SocketImpl's setOption(int, Object) or setOption(SocketOption, Object) methods. |
Thank you Alan and Daniel for the reviews. |
/integrate |
Going to push as commit 635cb3c.
Your commit was automatically rebased without conflicts. |
Can I please get a review of this doc-only changes to java.net.ServerSocket and java.net.Socket classes?
As noted in https://bugs.openjdk.org/browse/JDK-8329745, these classes currently refer to the legacy
java.net.SocketOptions
interface and instead should be refering to the newerjava.net.StandardSocketOptions
class. The commit in this PR updates such references. This change intentionally doesn't do any code changes to use theStandardSocketOptions
class - that can be done separately if desired at a later point (after testing for any compatibility issues). Finally, there are a few places in ServerSocket and Socket documentation which will continue to refer to java.net.SocketOptions legacy interface because few of the options aren't available in StandardSocketOptions class (for example,SO_TIMEOUT
).I ran
make docs-image
locally with this change and the generated doc looks OK to me.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18646/head:pull/18646
$ git checkout pull/18646
Update a local copy of the PR:
$ git checkout pull/18646
$ git pull https://git.openjdk.org/jdk.git pull/18646/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18646
View PR using the GUI difftool:
$ git pr show -t 18646
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18646.diff
Webrev
Link to Webrev Comment