From f166b51a3a2bccfe3a94911d4adba96d66929be2 Mon Sep 17 00:00:00 2001 From: bchristi Date: Thu, 13 Nov 2025 14:59:51 -0800 Subject: [PATCH] Remove ThreadPoolExecutor.finalize() --- .../util/concurrent/ThreadPoolExecutor.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java b/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java index 029e31ef9f6c0..b45b6eac83ec7 100644 --- a/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java +++ b/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java @@ -1426,23 +1426,6 @@ public boolean awaitTermination(long timeout, TimeUnit unit) } } - // Override without "throws Throwable" for compatibility with subclasses - // whose finalize method invokes super.finalize() (as is recommended). - // Before JDK 11, finalize() had a non-empty method body. - - /** - * @implNote Previous versions of this class had a finalize method - * that shut down this executor, but in this version, finalize - * does nothing. - * - * @deprecated Finalization has been deprecated for removal. See - * {@link java.lang.Object#finalize} for background information and details - * about migration options. - */ - @Deprecated(since="9", forRemoval=true) - @SuppressWarnings("removal") - protected void finalize() {} - /** * Sets the thread factory used to create new threads. *