tutorial on using Cleaner-based finalization

Rick Hillegas rick.hillegas at gmail.com
Wed May 3 02:08:49 UTC 2017


When I compile Apache Derby using JDK 9 build 167, I see several 
instances of the following warning:

    warning: [deprecation] finalize() in Object has been deprecated

The javadoc for java.lang.Object.finalize() suggests that affected 
classes should migrate their finalization to a coding pattern based on 
the newly introduced java.lang.ref.Cleaner class. I am hesitant to try 
my hand at this without more guidance. Can you point me at a tutorial or 
list of best practices for implementing Cleaner-based finalization?

Thanks,
-Rick


More information about the core-libs-dev mailing list