RFR: 8357686: Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer

Andrey Turbanov aturbanov at openjdk.org
Sat May 24 16:36:04 UTC 2025


Instead of separate `.get(Key)`+`.remove(Key)` calls we can call `.remove(Key, Value)`.
`peerMap` is an `IdentityHashMap`. IdentityHashMap.remove compares values with == since Java 20 ([JDK-8178355](https://bugs.openjdk.org/browse/JDK-8178355))

-------------

Commit messages:
 - [PATCH] Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer

Changes: https://git.openjdk.org/jdk/pull/24858/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24858&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357686
  Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/24858.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24858/head:pull/24858

PR: https://git.openjdk.org/jdk/pull/24858


More information about the client-libs-dev mailing list