Nicolai Parlog 2/10/2026

Removal of ThreadPoolExecutor.finalize()

Read Original

This article details the removal of ThreadPoolExecutor.finalize() in JDK 27 as part of the broader deprecation of finalizers (JEP 421). It explains the history of finalization, its problems, and the transition to alternatives like try-with-resources and Cleaner API. The removal introduces a source-incompatible change because ThreadPoolExecutor.finalize() does not declare Throwable, unlike Object.finalize(), causing compile errors for subclasses calling super.finalize(). The article provides guidance for developers to remove finalize() usage or use a workaround with try-catch. It is relevant to Java developers, software engineers, and those working on JDK migrations.

Removal of ThreadPoolExecutor.finalize()

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet