JDK-8371748 : Remove the (empty) ThreadPoolExecutor.finalize() method
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-11-13
  • Updated: 2025-12-05
  • Resolved: 2025-12-05
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 27
27 masterFixed
Related Reports
Blocks :  
CSR :  
Relates :  
Sub Tasks
JDK-8373057 :  
Description
Prior to JDK 11, ThreadPoolExecutor.finalize() was specified to
"[invoke] shutdown() when this executor is no longer referenced and it has no threads."

In JDK 11, ThreadPoolExecutor.finalize() was re-specified to do nothing, leaving the finalize() method empty. (JDK-8190324).

In JDK 18, finalize() was deprecated for removal (JDK-8276447), after first being "standard" deprecated in JDK 9 (JDK-8165641).

The finalize() method can safely be removed from ThreadPoolExecutor.
Comments
Changeset: f3dd8daa Branch: master Author: Brent Christian <bchristi@openjdk.org> Date: 2025-12-05 19:30:04 +0000 URL: https://git.openjdk.org/jdk/commit/f3dd8daaa92896be51254e5abf3e0ec5b1ff5173
05-12-2025

noreg-other: The ThreadPoolExecutor.finalize() method was already empty, so already did no cleanup. (Plus, I believe the VM has an optimization such that empty finalize() methods are not enqueued/called at all.) There seems no use in adding a runtime test for its removal.
05-12-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/28311 Date: 2025-11-13 23:10:59 +0000
13-11-2025

The continued presence of this finalize() method is causing warnings in test code, to wit: JDK-8371682.
13-11-2025