On Wed, 27 Apr 2022 18:13:15 GMT, Paul Sandoz <psan...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/PinnedThreadPrinter.java line 58:
>> 
>>> 56: 
>>> 57:     // maps a class to the hashes of stack traces pinned by that code 
>>> in that class
>>> 58:     private static final Map<Class<?>, Hashes> classToHashes = new 
>>> WeakHashMap<>();
>> 
>> Can you use `ClassValue` in this case?
>
> I was wondering that too, but held off commenting since it's not super 
> performance critical given `classToHashes` is synchronized on. However, it 
> does make the code a little clearer.

It's not critical and no problem if this is cleaned up as a follow-up.

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

PR: https://git.openjdk.java.net/jdk/pull/8166

Reply via email to