On Fri, 19 Nov 2021 00:14:34 GMT, Stuart Marks <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/ref/Finalizer.java line 195:
>>
>>> 193:
>>> 194: static {
>>> 195: if (Holder.ENABLED) {
>>
>> Hello Stuart,
>> My understanding of the the lazy `Holder` is that it's there to delay the
>> static initialization of the code that's part of the `Holder`. In this case
>> here, the `Holder` is being used right within the `static` block of the
>> `Finalizer` class, that too as the first thing. In this case, is that
>> `Holder` class necessary?
>
> I pushed an update to remove the Holder class. It seems to continue to work
> fine. Thanks for pointing this out @jaikiran !
Thank you Stuart, this changed version looks fine to me.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6442