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

8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable #3032

Closed
wants to merge 13 commits into from

Conversation

FrauBoes
Copy link
Member

@FrauBoes FrauBoes commented Mar 16, 2021

The fix makes the map in sun.net.httpserver.UnmodifiableHeaders unmodifiable by wrapping it in an unmodifiable view.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3032/head:pull/3032
$ git checkout pull/3032

Update a local copy of the PR:
$ git checkout pull/3032
$ git pull https://git.openjdk.java.net/jdk pull/3032/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3032

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3032.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 16, 2021

👋 Welcome back jboes! 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 Mar 16, 2021

@FrauBoes 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 Mar 16, 2021
@FrauBoes FrauBoes marked this pull request as ready for review March 22, 2021 15:29
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 22, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 22, 2021

Webrevs

@dfuch
Copy link
Member

dfuch commented Mar 29, 2021

The changes LGTM. What about modifying ExchangeImpl to create the UnmodifiableHeaders in its constructor, instead of creating a new instance every time getRequestHeaders() is called?


Headers map;
private final Headers headers;
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment here that Headers is mutable, but no reference to it escapes.

Also, can you fix the indentation of the other existing methods.

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
Copy link

openjdk bot commented Mar 31, 2021

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

8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable

Reviewed-by: michaelm, dfuchs

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

  • d3fdd73: 8264173: [s390] Improve Hardware Feature Detection And Reporting
  • 9d65039: 8263984: Invalidate printServices when there are no printers
  • adb860e: 8255800: Raster creation methods need some specification clean up
  • eab8455: 8261137: Optimization of Box nodes in uncommon_trap

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 ready Pull request is ready to be integrated label Mar 31, 2021
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.

LGTM

@FrauBoes
Copy link
Member Author

FrauBoes commented Apr 6, 2021

I included a null check in the constructor to account for null values of List<String>, which Headers allows. Fixed the indentation.

Testing: Tier 1-3 all clear.

@FrauBoes
Copy link
Member Author

FrauBoes commented Apr 7, 2021

It turns out I wasn't right in the last commit. The null check is not needed in the constructor, but in the get method, where Headers::get can return null, which can cause Collections.unmodifiableList to throw NPE. I updated the get method and added some more test cases to confirm equality of Headers and UnmodifiableHeaders instances.

Testing: Tier 1-3 all clear.

@Michael-Mc-Mahon
Copy link
Member

Latest changes LGTM.

@FrauBoes
Copy link
Member Author

FrauBoes commented Apr 8, 2021

/integrate

@openjdk openjdk bot closed this Apr 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 8, 2021
@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@FrauBoes Since your change was applied there have been 18 commits pushed to the master branch:

  • af13c64: 8264711: More runtime TRAPS cleanups
  • 3aec2d9: 8264718: Shenandoah: enable string deduplication during root scanning
  • 255afbe: 8264672: runtime/ParallelLoad/ParallelSuperTest.java timed out
  • ec599da: 8264633: Add missing logging to PlatformRecording#stop
  • e89542f: 8264352: AArch64: Optimize vector "not/andNot" for NEON and SVE
  • 016db40: 8263907: Specification of CellRendererPane::paintComponent(..Rectangle) should clearly mention which method it delegates the call to
  • 78d1164: 8214455: Relocate CDS archived regions to the top of the G1 heap
  • 88eb291: 8264809: test-lib fails to build due to some warnings in ASN1Formatter and jfr
  • a863ab6: 8264551: Unexpected warning when jpackage creates an exe
  • 6e2b82a: 8264731: Introduce InstanceKlass::method_at_itable_or_null()
  • ... and 8 more: https://git.openjdk.java.net/jdk/compare/92fad1b4088ca6c7738bfe9c95da15249f40ef74...master

Your commit was automatically rebased without conflicts.

Pushed as commit 214d6e2.

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

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