JDK-8373057 : Release Note: Removal of ThreadPoolExecutor.finalize()
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Affected Version: 27
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-12-03
  • Updated: 2025-12-08
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
27Unresolved
Description
The `ThreadPoolExecutor.finalize()` method has been removed. It was deprecated for removal in JDK 18.

All Java classes can inherit the `Object.finalize()` method, which is declared to throw `Throwable`. However `ThreadPoolExecutor` overrode `finalize()` to *not* throw an exception.

With the removal of `ThreadPoolExecutor.finalize()`, any existing code that extends `ThreadPoolExecutor` and overrides `finalize()` to call `super.finalize()` (or calls `finalize()` directly) will now be calling `Object.finalize()`. If such code does not account for `Throwable`, it will encounter an "`unreported exception Throwable`" compilation error. This can be addressed by updating affected methods to throw `Throwable`, or with a *try-catch* block.

Note that as of [JEP 421](https://openjdk.org/jeps/421), all code should stop using finalizers.

Comments
[~bchristi] Here's a few sentences that may be useful to incorporate: The `finalize()` method has been removed from `java.util.concurrent.ThreadPoolExecutor`. `ThreadPoolExecutor.finalize()` was deprecated in JDK 9 as part of the deprecating finalization for removal (JEP 421). The method was -respecified in JDK 11 to "do nothing" and deprecated for removal in JDK 18. Code that extends `ThreadPoolExecurtor` and invokes `super.finalize(`) may no longer compile as `Object.finalize` throws `Throwable`.
04-12-2025