Skip to content

Conversation

@FrauBoes
Copy link
Member

@FrauBoes FrauBoes commented Jun 18, 2021

com.sun.net.httpserver.Headers normalizes its keys to adhere to the following format: First character uppercase, all other characters lowercase, for example "foo" -> "Foo". This behaviour is not consistent across the mutator methods of the class, in particular putAll() and replaceAll() do not apply normalization.

The suggested fix is to update the implementation of putAll() and to add an implementation of of the java.util.Map default method replaceAll(). While here, we can add a toString() implementation to provide a more informative string.

Additionally, the Headers class is updated to disallow null values for keys and values.

Testing: tier 1-3 all clear
CSR: https://bugs.openjdk.java.net/browse/JDK-8269296


Progress

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

Issue

  • JDK-8268960: com/sun/net/httpserver/Headers.java: Ensure mutators normalize keys and disallow null for keys and values

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4528

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 18, 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 Jun 18, 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 Jun 18, 2021
@FrauBoes FrauBoes marked this pull request as ready for review June 18, 2021 10:52
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 18, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 18, 2021

Webrevs

@FrauBoes FrauBoes changed the title 8268960: com/sun/net/httpserver/Headers.java: Ensure all mutator methods normalize keys 8268960: com/sun/net/httpserver/Headers.java: Ensure mutators normalize keys and disallow null for keys and values Jun 21, 2021
@FrauBoes
Copy link
Member Author

/csr needed

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 21, 2021
@openjdk
Copy link

openjdk bot commented Jun 21, 2021

@FrauBoes has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@FrauBoes please create a CSR request for issue JDK-8268960. This pull request cannot be integrated until the CSR request is approved.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Jun 30, 2021
@openjdk
Copy link

openjdk bot commented Jun 30, 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:

8268960: com/sun/net/httpserver/Headers.java: Ensure mutators normalize keys and disallow null for keys and values

Reviewed-by: chegar, 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 182 new commits pushed to the master branch:

  • 54a9c3e: 8133873: Simplify {Register,Unregister}NMethodOopClosure
  • 06d2620: 8268298: jdk/jfr/api/consumer/log/TestVerbosity.java fails: unexpected log message
  • d89e630: 8266746: C1: Replace UnsafeGetRaw with UnsafeGet when setting up OSR entry block
  • 4660f72: 8268870: Remove dead code in metaspaceShared
  • 9def3b0: Merge
  • 9ac63a6: 8262841: Clarify the behavior of PhantomReference::refersTo
  • aba6c55: 8269703: ProblemList vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java on Windows-X64 with -Xcomp
  • 3e02224: 8269513: Clarify the spec wrt useOldISOCodes system property
  • 0dc65d3: 8268897: [TESTBUG] compiler/compilercontrol/mixed/RandomCommandsTest.java must not fail on Command.quiet
  • 3826012: 8268557: Module page uses unstyled table class
  • ... and 172 more: https://git.openjdk.java.net/jdk/compare/f4d20b215eb3c90ca28bf973e7614486226692b5...master

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 Jun 30, 2021
@FrauBoes
Copy link
Member Author

FrauBoes commented Jul 1, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Jul 1, 2021

Going to push as commit 82bfc5d.
Since your change was applied there have been 183 commits pushed to the master branch:

  • 18f356a: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title
  • 54a9c3e: 8133873: Simplify {Register,Unregister}NMethodOopClosure
  • 06d2620: 8268298: jdk/jfr/api/consumer/log/TestVerbosity.java fails: unexpected log message
  • d89e630: 8266746: C1: Replace UnsafeGetRaw with UnsafeGet when setting up OSR entry block
  • 4660f72: 8268870: Remove dead code in metaspaceShared
  • 9def3b0: Merge
  • 9ac63a6: 8262841: Clarify the behavior of PhantomReference::refersTo
  • aba6c55: 8269703: ProblemList vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java on Windows-X64 with -Xcomp
  • 3e02224: 8269513: Clarify the spec wrt useOldISOCodes system property
  • 0dc65d3: 8268897: [TESTBUG] compiler/compilercontrol/mixed/RandomCommandsTest.java must not fail on Command.quiet
  • ... and 173 more: https://git.openjdk.java.net/jdk/compare/f4d20b215eb3c90ca28bf973e7614486226692b5...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 1, 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 Jul 1, 2021
@openjdk
Copy link

openjdk bot commented Jul 1, 2021

@FrauBoes Pushed as commit 82bfc5d.

💡 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.

4 participants