JDK-8263903 : Use Cleaner instead of finalize to auto stop Timer thread
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-03-20
  • Updated: 2021-03-29
  • Resolved: 2021-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b15Fixed
Related Reports
Relates :  
Description
Object.finalize has been deprecated and uses of finalize should be converted to use PhantomReferece, possibly via java.lang.ref.Cleaner.

Each java.util.Timer has an associated thread.  This thread needs to be signaled to self-terminate if the owning Timer object becomes unreachable.  This is currently implemented via an internal supporting object with a finalize method.

Comments
Changeset: 2425462a Author: Kim Barrett <kbarrett@openjdk.org> Date: 2021-03-23 21:16:35 +0000 URL: https://git.openjdk.java.net/jdk/commit/2425462a
23-03-2021