RFR: JDK-8276422 Add command-line option to disable finalization [v4]
Stuart Marks
smarks at openjdk.java.net
Fri Nov 19 00:17:41 UTC 2021
On Thu, 18 Nov 2021 04:13:21 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Stuart Marks has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove Finalizer.Holder class.
>
> 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 !
-------------
PR: https://git.openjdk.java.net/jdk/pull/6442
More information about the core-libs-dev
mailing list