RFR: 8263903: Use Cleaner instead of finalize to auto stop Timer thread [v4]

Kim Barrett kbarrett at openjdk.java.net
Tue Mar 23 21:14:02 UTC 2021


> Please review this change to java.util.Timer, replacing the use of deprecated finalization-based cleanup with use of java.lang.ref.Cleaner.
> 
> In addition, Timer.cancel now cancels any later execution of the the no longer relevant cleanup.
> 
> Testing:
> mach5 tier1
> New AutoStop test verifies the specified cleanup behavior.
> (There are existing tests involving Timer.cancel.)

Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge branch 'master' into nofinalize
 - make ThreadReaper constructor non-public
 - dholmes review
 - Use cleaner instead of finalize to auto stop Timer thread

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3106/files
  - new: https://git.openjdk.java.net/jdk/pull/3106/files/57500464..f62aa2f0

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3106&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3106&range=02-03

  Stats: 2955 lines in 191 files changed: 1549 ins; 748 del; 658 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3106.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3106/head:pull/3106

PR: https://git.openjdk.java.net/jdk/pull/3106


More information about the core-libs-dev mailing list