<i18n dev> RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener

Chen Liang liach at openjdk.org
Mon May 19 08:14:29 UTC 2025


On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null`

Makes sense. This map is private, and its value is always non-null (only one other put site), so I believe things are fine here.

Let another reviewer in area to confirm this change.

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

Marked as reviewed by liach (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24692#pullrequestreview-2773119715
PR Comment: https://git.openjdk.org/jdk/pull/24692#issuecomment-2810091497


More information about the i18n-dev mailing list