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

Sergey Bylokhov serb at openjdk.org
Fri Jun 13 10:01:33 UTC 2025


On Thu, 24 Apr 2025 20:18:01 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> 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))

Marked as reviewed by serb (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/24858#pullrequestreview-2924156759


More information about the client-libs-dev mailing list