Skip to content
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

8333590: UnmodifiableHeaders.toString() returns a value that represents empty headers #19555

Closed
wants to merge 2 commits into from

Conversation

jaikiran
Copy link
Member

@jaikiran jaikiran commented Jun 5, 2024

Can I please get a review of this change which proposes to fix the issue noted in https://bugs.openjdk.org/browse/JDK-8333590?

As noted in that issue the sun.net.httpserver.UnmodifiableHeaders, an internal class, within the jdk.httpserver module doesn't override the toString() method. UnmodifiableHeaders is of type com.sun.net.httpserver.Headers which is a public API in the jdk.httpserver module.

When applications call Headers.toString(), if the instance is of type UnmodifiableHeaders, then the returned String representation shows empty headers, even when it isn't empty. The commit in this PR fixes the issue by implementing toString() in the UnmodifiableHeaders to return the correct representation of the headers.

An existing jtreg test has been updated to reproduce this issue and verify the fix.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8333590: UnmodifiableHeaders.toString() returns a value that represents empty headers (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19555/head:pull/19555
$ git checkout pull/19555

Update a local copy of the PR:
$ git checkout pull/19555
$ git pull https://git.openjdk.org/jdk.git pull/19555/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19555

View PR using the GUI difftool:
$ git pr show -t 19555

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19555.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 5, 2024

👋 Welcome back jpai! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 5, 2024

@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:

8333590: UnmodifiableHeaders.toString() returns a value that represents empty headers

Reviewed-by: dfuchs, michaelm

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 8 new commits pushed to the master branch:

  • 789f704: 8322732: ForkJoinPool may underutilize cores in async mode
  • 2c1b311: 8331854: ubsan: copy.hpp:218:10: runtime error: addition of unsigned offset to 0x7fc2b4024518 overflowed to 0x7fc2b4024510
  • 765ad0e: 8331947: Preview creates checkbox for JEP-less preview feature
  • 8e903ee: 8331896: JFR: Improve check for JDK classes
  • 3cbdf8d: 8333554: Parallel: Remove unused PSParallelCompact::is_in
  • 3944e67: 8312132: Add tracking of multiple address spaces in NMT
  • d0052c0: 8333326: Linux Alpine build fails after 8302744
  • 4369856: 8333130: MakeJAR2.sh uses hard-coded JDK version

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 5, 2024
@openjdk
Copy link

openjdk bot commented Jun 5, 2024

@jaikiran The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Jun 5, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 5, 2024

Webrevs

…leHeaders.java

Co-authored-by: Daniel Fuchs <67001856+dfuch@users.noreply.github.com>
Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 5, 2024
Copy link
Member

@Michael-Mc-Mahon Michael-Mc-Mahon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@jaikiran
Copy link
Member Author

jaikiran commented Jun 5, 2024

Thank you Daniel and Michael for the reviews. CI tier tests came back fine. I'll go ahead with the integration shortly.

@jaikiran
Copy link
Member Author

jaikiran commented Jun 5, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jun 5, 2024

Going to push as commit 6882b38.
Since your change was applied there have been 9 commits pushed to the master branch:

  • cbb6747: 8329581: Java launcher no longer prints a stack trace
  • 789f704: 8322732: ForkJoinPool may underutilize cores in async mode
  • 2c1b311: 8331854: ubsan: copy.hpp:218:10: runtime error: addition of unsigned offset to 0x7fc2b4024518 overflowed to 0x7fc2b4024510
  • 765ad0e: 8331947: Preview creates checkbox for JEP-less preview feature
  • 8e903ee: 8331896: JFR: Improve check for JDK classes
  • 3cbdf8d: 8333554: Parallel: Remove unused PSParallelCompact::is_in
  • 3944e67: 8312132: Add tracking of multiple address spaces in NMT
  • d0052c0: 8333326: Linux Alpine build fails after 8302744
  • 4369856: 8333130: MakeJAR2.sh uses hard-coded JDK version

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 5, 2024
@openjdk openjdk bot closed this Jun 5, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 5, 2024
@openjdk
Copy link

openjdk bot commented Jun 5, 2024

@jaikiran Pushed as commit 6882b38.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@jaikiran jaikiran deleted the 8333590 branch June 5, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants