On Fri, 19 Nov 2021 18:06:39 GMT, Mandy Chung <[email protected]> wrote:
>> Here are the code changes for the "Deprecate finalizers in the standard Java
>> API" portion of JEP 421 ("Deprecate Finalization for Removal") for code
>> review.
>>
>> This change makes the indicated deprecations, and updates the API spec for
>> JEP 421. It also updates the relevant @SuppressWarning annotations.
>>
>> The CSR has been approved.
>> An automated test build+test run passes cleanly (FWIW :D ).
>
> src/java.base/share/classes/java/lang/Object.java line 481:
>
>> 479: * system resources or to perform other cleanup.
>> 480: * <p>
>> 481: * <b>When running in a Java virtual machine in which finalization
>> has been
>
> Disabling finalization is not part of the Java SE spec. This paragraph
> describes the implementation of HotSpot VM and I think it does not belong to
> this javadoc.
The coupling between this change and
[8276422](https://bugs.openjdk.java.net/browse/JDK-8276422) ("Add command-line
option to disable finalization") is probably tighter than would be ideal. That
[CSR](https://bugs.openjdk.java.net/browse/JDK-8276773) allows for finalization
to be disabled in the SE Platform Spec and the JLS.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6465