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

8281289: Improve with List.copyOf #7356

Closed
wants to merge 1 commit into from

Conversation

XueleiFan
Copy link
Member

@XueleiFan XueleiFan commented Feb 4, 2022

Please review this trivial code clean up, for a little bit better performance.


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7356

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 4, 2022

👋 Welcome back xuelei! 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 openjdk bot added the rfr label Feb 4, 2022
@openjdk
Copy link

openjdk bot commented Feb 4, 2022

@XueleiFan The following labels will be automatically applied to this pull request:

  • net
  • security

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

@openjdk openjdk bot added security net labels Feb 4, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 4, 2022

Webrevs

jnimeh
jnimeh approved these changes Feb 5, 2022
Copy link
Member

@jnimeh jnimeh left a comment

Looks good to me.

@openjdk
Copy link

openjdk bot commented Feb 5, 2022

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

8281289: Improve with List.copyOf

Reviewed-by: jnimeh, hchao

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

  • 48523b0: 8281049: man page update for jstatd Security Manager dependency removal
  • 8e4ef81: 8280767: -XX:ArchiveClassesAtExit does not archive BoundMethodHandle$Species classes
  • f5d6fdd: 8280476: [macOS] : hotspot arm64 bug exposed by latest clang
  • d4b99bc: 8281120: G1: Rename G1BlockOffsetTablePart::alloc_block to update_for_block
  • 66b2c3b: 8280948: [TESTBUG] Write a regression test for JDK-4659800
  • 7207f2a: Merge
  • 01f93dd: 8279385: [test] Adjust sun/security/pkcs12/KeytoolOpensslInteropTest.java after 8278344
  • 3d926dd: 8277795: ldap connection timeout not honoured under contention
  • 51b53a8: 8280913: Create a regression test for JRootPane.setDefaultButton() method
  • 46c6c6f: 8281043: Intrinsify recursive ObjectMonitor locking for PPC64
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/a95ee5ada230a0177517efd3a417f319066169dd...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 label Feb 5, 2022
@haimaychao
Copy link
Contributor

haimaychao commented Feb 5, 2022

Looks good to me.

@XueleiFan
Copy link
Member Author

XueleiFan commented Feb 5, 2022

/integrate

Thank you for the quick code review @jnimeh @haimaychao!

@openjdk
Copy link

openjdk bot commented Feb 5, 2022

Going to push as commit 42e272e.
Since your change was applied there have been 22 commits pushed to the master branch:

  • 48523b0: 8281049: man page update for jstatd Security Manager dependency removal
  • 8e4ef81: 8280767: -XX:ArchiveClassesAtExit does not archive BoundMethodHandle$Species classes
  • f5d6fdd: 8280476: [macOS] : hotspot arm64 bug exposed by latest clang
  • d4b99bc: 8281120: G1: Rename G1BlockOffsetTablePart::alloc_block to update_for_block
  • 66b2c3b: 8280948: [TESTBUG] Write a regression test for JDK-4659800
  • 7207f2a: Merge
  • 01f93dd: 8279385: [test] Adjust sun/security/pkcs12/KeytoolOpensslInteropTest.java after 8278344
  • 3d926dd: 8277795: ldap connection timeout not honoured under contention
  • 51b53a8: 8280913: Create a regression test for JRootPane.setDefaultButton() method
  • 46c6c6f: 8281043: Intrinsify recursive ObjectMonitor locking for PPC64
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/a95ee5ada230a0177517efd3a417f319066169dd...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Feb 5, 2022
@openjdk openjdk bot closed this Feb 5, 2022
@openjdk openjdk bot removed ready rfr labels Feb 5, 2022
@openjdk
Copy link

openjdk bot commented Feb 5, 2022

@XueleiFan Pushed as commit 42e272e.

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

@XueleiFan XueleiFan deleted the JDK-8281289 branch Feb 5, 2022
@cl4es
Copy link
Member

cl4es commented Feb 5, 2022

There's a small compatibility risk with this change, e.g., List.copyOf(...).contains(null) will throw NPE while Collections.unmodifiableList(...).contains(null) won't.

If we accept that compatibility risk (which should probably be decided by CSR) it might also make sense to use List.of() for the empty case, which will reduce the number of List implementation classes returned from the API.

@XueleiFan
Copy link
Member Author

XueleiFan commented Feb 5, 2022

There's a small compatibility risk with this change, e.g., List.copyOf(...).contains(null) will throw NPE while Collections.unmodifiableList(...).contains(null) won't.

If we accept that compatibility risk (which should probably be decided by CSR) it might also make sense to use List.of() for the empty case, which will reduce the number of List implementation classes returned from the API.

All GOOD points! Thanks!

I filed a new JDK-8281298, and a new pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated net security
4 participants