Java’s Object.finalize capability is on the chopping block, deemed more trouble than it’s worth. But expect it to stick around for a while.
Deprecation has been proposed for Java Development Kit (JDK) 9, Oracle said. Oracle recommends that the capability no longer be used and a warning will be issued. Initially, Object.finalize won’t be deprecated for removal, so at the earliest, it could be dropped in Java SE 11. With JDK 9 due this July and JDK 10 presumably in the mix, the capability could still be available for several years.
A part of Java since the nearly 22-year-old language was founded, the Object.finalize method provides object cleanup operations before an object is discarded. However, the timing is unpredictable, with no guarantee the finalizer will be called, according to Oracle.