To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call.
------------- Commit messages: - [PATCH] Avoid redundant WeakHashMap.get to obtain old value in Toolkit Changes: https://git.openjdk.org/jdk/pull/24691/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24691&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356843 Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24691.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24691/head:pull/24691 PR: https://git.openjdk.org/jdk/pull/24691