RFR: 8278065: Refactor subclassAudits to use ClassValue [v3]
Roman Kennke
rkennke at openjdk.java.net
Wed Jan 12 11:18:28 UTC 2022
On Wed, 12 Jan 2022 06:45:02 GMT, Peter Levart <plevart at openjdk.org> wrote:
> I think this looks good. Reviewed. Only a minor nit if you think it would be better, but not necessary if you don't. The following combo:
>
> ```
> Boolean result = Caches.subclassAudits.get(cl);
> assert result != null;
> ```
>
> could be written as:
>
> ```
> boolean result = Caches.subclassAudits.get(cl);
> ```
>
> ...and it would give the same "message" to the reader. WDYT? No need for another round of reviews if you change this.
Right! I changed it.
BTW, I noticed that Thread.java has a similar subclassAudits machinery with WeakClassKey, which would also benefit from using ClassValue instead. I filed JDK-8279917 to track it.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6637
More information about the core-libs-dev
mailing list