RFR: JDK-8276422 Add command-line option to disable finalization [v4]

Jaikiran Pai jpai at openjdk.java.net
Fri Nov 19 04:24:37 UTC 2021


On Fri, 19 Nov 2021 00:14:34 GMT, Stuart Marks <smarks at openjdk.org> 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


More information about the core-libs-dev mailing list