On Mon, 20 Feb 2023 18:34:17 GMT, Alan Bateman <al...@openjdk.org> wrote:
> Executors.newSingleThreadExecutor returns a delegating ExecutorService that > has finalizer to shutdown the underlying TPE when the wrapper is finalizable. > It goes back to JDK 6 and JDK-6399443. This is the last non-empty finalizer > in java.base. Removing it will likely lead to bug reports/complaints as the > current behavior goes back to 2006. So the proposal is to just replace it > with a Cleaner, trivially done in this case. As part of the changes, I've > replaced the existing test with a more modern test that exercises more > scenarios. LGTM src/java.base/share/classes/java/util/concurrent/Executors.java line 192: > 190: * @throws NullPointerException if threadFactory is null > 191: */ > 192: Extra blank line. ------------- Marked as reviewed by rriggs (Reviewer). PR: https://git.openjdk.org/jdk/pull/12675