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

8287696: Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta #8935

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented May 28, 2022

Hashtable doesn't allow null values. So, instead of pair containsKey/remove calls, we can directly call remove and then compare result with null.

if (sigFileSigners.containsKey(manifestName)) {
CodeSigner[] codeSigners = sigFileSigners.remove(manifestName);
verifiedSigners.put(manifestName, codeSigners);
}


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-8287696: Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8935

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 28, 2022

👋 Welcome back aturbanov! 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 May 28, 2022

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

  • core-libs
  • 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 security-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels May 28, 2022
@turbanoff turbanoff changed the title [PATCH] Avoid redundant Hashtable.containsKey call in JarVerifier 8287696: Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta Jun 1, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 1, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 1, 2022

Webrevs

Copy link
Member

@jaikiran jaikiran 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 to me. Please wait for another review before merging.

@openjdk
Copy link

openjdk bot commented Jun 6, 2022

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

8287696: Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta

Reviewed-by: jpai, lancea

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

  • 975316e: 8287902: UnreadableRB case in MissingResourceCauseTest is not working reliably on Windows
  • 0901548: 8283724: Incorrect description for jtreg-failure-handler option
  • dae4c49: 8286197: C2: Optimize MemorySegment shape in int loop
  • 94b473e: 8280454: G1: ClassLoaderData verification keeps CLDs live that causes problems with VerifyDuringGC during Remark
  • 900d967: 8287924: Avoid redundant HashMap.containsKey call in EnvHelp.mapToHashtable
  • d482d7f: 8286160: (fs) Files.exists returns unexpected results with C:\pagefile.sys because it's not readable
  • edff51e: 8284858: Start of release updates for JDK 20
  • 2671443: 8286171: HttpClient/2 : Expect:100-Continue blocks indefinitely when response is not 100
  • 59b0de6: 8288048: Build failure with GCC 6 after JDK-8286562
  • db4405d: 8288078: linux-aarch64-optimized build fails in Tier5 after JDK-8287567
  • ... and 197 more: https://git.openjdk.org/jdk/compare/2c461acfebd28fe5ef62805cbb004f91a3b18f08...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 6, 2022
Copy link
Contributor

@LanceAndersen LanceAndersen left a comment

Choose a reason for hiding this comment

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

The changes to doneWithMeta() seem reasonable and the other changes remove unused code so look OK to me

@turbanoff
Copy link
Member Author

Thank you for review!
/integrate

@openjdk
Copy link

openjdk bot commented Jun 11, 2022

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

  • d46f404: 8279047: Remove expired flags in JDK 20
  • f7a4be7: 8288270: Tier1 build failures after JDK-8287178
  • d4b473d: 8287178: IntegerModuloP::multiplicativeInverse returns 0 for 0
  • da2339c: 8288173: JDK-8202449 fix causes conformance test failure : api/java_util/Random/RandomGenerator/NextFloat.html
  • f2e10dc: 8288238: Add missing file jdk.incubator.concurrent-J.sym.txt
  • fa564e9: Merge
  • 0164145: 8288222: ProblemList serviceability/jvmti/vthread/VThreadNotifyFramePopTest/VThreadNotifyFramePopTest.java
  • 03276a5: 8281445: Document the default value for the override-methods option
  • d0c8ff8: 8288195: Prepare build system for GHA changes
  • 7e940ef: 8286038: Update --release 19 symbol information for JDK 19 build 26
  • ... and 215 more: https://git.openjdk.org/jdk/compare/2c461acfebd28fe5ef62805cbb004f91a3b18f08...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 11, 2022

@turbanoff Pushed as commit f1143b1.

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

@turbanoff turbanoff deleted the redundant_Hashtable.containsKey_JarVerifier branch October 27, 2022 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated security security-dev@openjdk.org
3 participants