-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8235786: Javadoc for com/sun/net/httpserver/HttpExchange.java#setAttribute is unclear #22454
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
Conversation
…ibute is unclear
/csr needed |
👋 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 33 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 |
@jaikiran has indicated that a compatibility and specification (CSR) request is needed for this pull request. @jaikiran please create a CSR request for issue JDK-8235786 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Webrevs
|
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.
Thanks for this clarification. I was bitten by that too the first time I used these attributes.
The CSR is now ready for review https://bugs.openjdk.org/browse/JDK-8345243 |
@@ -233,22 +233,28 @@ protected HttpExchange() { | |||
public abstract String getProtocol(); | |||
|
|||
/** | |||
* {@link Filter} modules may store arbitrary objects with {@code HttpExchange} | |||
* instances as an out-of-band communication mechanism. Other filters | |||
* {@return the attribute's value from this exchange's |
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.
It looks a bit odd in the generated doc that this statement appears as the summary and is then repeated verbatim in the @returns. Could the first sentence be a shorter summary?
Also, since we are clarifying the spec here, could a small test be added?
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 @return
to split it into separate sentences and also updated an existing test to include the testing for HttpExchange.getAttribute()
and setAttribute()
. The test continues to pass. I'll run it through our CI 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.
Still looks good (and even better) :-)
…ibute()
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.
Looks good!
Thank you Michael and Daniel for the reviews. The CSR has been approved and tier1 and tier2 testing has passed with this change. I'll go ahead and integrate this now. |
/integrate |
Going to push as commit 40ae469.
Your commit was automatically rebased without conflicts. |
Can I please get a review of this doc-only change which proposes to clarify the behaviour of
com.sun.net.httpserver.HttpExchange.setAttribute()
andcom.sun.net.httpserver.HttpExchange.getAttribute()
methods?As noted in https://bugs.openjdk.org/browse/JDK-8235786, it's not clear from the javadoc of these methods that the attributes that are set or retrieved through the exchange are actually those that belong to the entire
com.sun.net.httpserver.HttpContext
and thus are shared by all exchanges.The commit in this PR specifies this behaviour to match the current implementation. I'll file a CSR once we settle on the text.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22454/head:pull/22454
$ git checkout pull/22454
Update a local copy of the PR:
$ git checkout pull/22454
$ git pull https://git.openjdk.org/jdk.git pull/22454/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22454
View PR using the GUI difftool:
$ git pr show -t 22454
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22454.diff
Using Webrev
Link to Webrev Comment