On Wed, 15 Jul 2026 02:03:04 GMT, David Holmes <[email protected]> wrote:

>> I tend to agree with @ExE-Boss here. Vagaries of finalizers aside, if the 
>> subclass can be an identity class then the superclass's finalizer should be 
>> registered for instances of the subclass. Otherwise the JEP needs to state 
>> clearly that this is the case.
>
> FTR the behaviour was ratified by a spec update through JDK-8387417

For future reference, https://github.com/openjdk/valhalla/pull/2588/ updated 
the specification of Object.finalize() to specify:


* <div class="preview-block">
*      <div class="preview-comment">
*          The {@code finalize} method of a value class is never directly
*          invoked by the garbage collector. This includes the case where an
*          abstract value class declares a {@code finalize} method and the
*          class is extended by an identity class; the garbage collector never
*          directly invokes the {@code finalize} method declared by the
*          abstract value class.
*      </div>
* </div>

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2589#discussion_r3583977425

Reply via email to