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

8287148: Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes.getExtendedKeyCodeForChar #8489

Conversation

turbanoff
Copy link
Member

@turbanoff turbanoff commented Apr 30, 2022

sun.awt.ExtendedKeyCodes#regularKeyCodesMap contains only non-null values. It means we can replace containsKey+get with get+null check.
It's clearer and a bit faster.


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-8287148: Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes.getExtendedKeyCodeForChar

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8489

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

Using diff file

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

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 30, 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 Apr 30, 2022

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

  • client

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 client client-libs-dev@openjdk.org label Apr 30, 2022
@turbanoff turbanoff changed the title [PATCH] Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes 8287148: Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes.getExtendedKeyCodeForChar May 23, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label May 23, 2022
@mlbridge
Copy link

mlbridge bot commented May 23, 2022

Webrevs

@mlbridge
Copy link

mlbridge bot commented May 24, 2022

Mailing list message from Patrick Chen on client-libs-dev:

"It's clearer and a bit faster." yeah totally agree

Le lun. 23 mai 2022 ? 11:03, Andrey Turbanov <aturbanov at openjdk.java.net> a
?crit :

@openjdk
Copy link

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

8287148: Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes.getExtendedKeyCodeForChar

Reviewed-by: prr

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

  • b6cdfd6: 8287740: NSAccessibilityShowMenuAction not working for text editors
  • 25e9901: 8285305: Create an automated test for JDK-4495286
  • 6f526e1: 8285373: Create an automated test for JDK-4702233
  • a7e07fd: 8287102: ImageReaderSpi.canDecodeInput() for standard plugins should return false if a stream is too short
  • 7a0c8b1: 8286850: [macos] Add support for signing user provided app image
  • 0b35460: 8283694: Improve bit manipulation and boolean to integer conversion operations on x86_64
  • a0219da: 8287517: C2: assert(vlen_in_bytes == 64) failed: 2
  • ce5ae51: 8287637: Loom: Mismatched VirtualThread::state accessor
  • 59e9700: 8252717: Integrate/merge legacy standard doclet diagnostics and doclint
  • 28c112f: 8287685: [BACKOUT] JDK-8287384 Speed up jdk.test.lib.util.ForceGC
  • ... and 502 more: https://git.openjdk.java.net/jdk/compare/d9541c5e9f68f2b76e6e1d09bc24750b7c9a5b5b...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 3, 2022
@turbanoff
Copy link
Member Author

Thank you for review!
/integrate

@openjdk
Copy link

openjdk bot commented Jun 7, 2022

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

  • 74be2d9: 8286983: rename jdb -trackvthreads and debug agent enumeratevthreads options and clarify "Preview Feature" nature of these options
  • 8e10c2b: 8287877: Exclude vmTestbase/nsk/jvmti/AttachOnDemand/attach022/TestDescription.java until JDK-8277573 is fixed
  • 9ec27d0: 8287872: Disable concurrent execution of hotspot docker tests
  • 91e6bf6: 8287919: ProblemList java/lang/CompressExpandTest.java
  • 3da7e39: 8287840: Dead copy region node blocks IfNode's fold-compares
  • c41a283: 8273853: Update the Java manpage for automatic CDS archive updating
  • 41d5809: 8287811: JFR: jfr configure error message should not print stack trace
  • 5d4ea9b: 8273346: Expand library mappings to IEEE 754 operations
  • 96641c0: 8287745: jni/nullCaller/NullCallerTest.java fails with "exitValue = 1"
  • 67f1bd7: 8286620: Create regression test for verifying setMargin() of JRadioButton
  • ... and 557 more: https://git.openjdk.java.net/jdk/compare/d9541c5e9f68f2b76e6e1d09bc24750b7c9a5b5b...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 7, 2022

@turbanoff Pushed as commit 1aa87e0.

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

@turbanoff turbanoff deleted the redundant_Map.containsKey_in_ExtendedKeyCodes branch October 27, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

2 participants