From 71ef6f98527a3119ed5a68db93b4854126e92572 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 21 Apr 2026 13:09:56 +0200 Subject: [PATCH] Remove BundleActivator from org.eclipse.jface.text The Activator class only held a single ExecutorService used by AsyncCompletionProposalPopup. Neither the start() hook nor the stored BundleContext were used. Convert the class to a final holder with a static, lazily initialized ExecutorService (daemon threads, no JVM liveness impact) and drop the Bundle-Activator header from the manifest. The public surface (Activator.ID and Activator.getExecutor()) is preserved so existing API consumers continue to compile and run. --- .../.settings/.api_filters | 23 +++++++++++++ .../META-INF/MANIFEST.MF | 1 - .../src/org/eclipse/jface/text/Activator.java | 33 +++---------------- 3 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 bundles/org.eclipse.jface.text/.settings/.api_filters diff --git a/bundles/org.eclipse.jface.text/.settings/.api_filters b/bundles/org.eclipse.jface.text/.settings/.api_filters new file mode 100644 index 00000000000..96481a9498c --- /dev/null +++ b/bundles/org.eclipse.jface.text/.settings/.api_filters @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF b/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF index 653c7b05d9d..548d3c13eb1 100644 --- a/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF @@ -41,6 +41,5 @@ Require-Bundle: Import-Package: com.ibm.icu.text Bundle-RequiredExecutionEnvironment: JavaSE-21 Automatic-Module-Name: org.eclipse.jface.text -Bundle-Activator: org.eclipse.jface.text.Activator Bundle-ActivationPolicy: lazy Require-Capability: eclipse.swt;filter:="(image.format=svg)" diff --git a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/Activator.java b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/Activator.java index 1e207f72696..a88d759ef28 100644 --- a/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/Activator.java +++ b/bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/Activator.java @@ -7,47 +7,24 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - /** * @since 3.29 */ -public class Activator implements BundleActivator { +public class Activator { /** * The identifier of the descriptor of this plugin in plugin.xml. */ public static final String ID= "org.eclipse.jface.text"; //$NON-NLS-1$ - private static Activator activator; - - private ExecutorService executor; - - @Override - public void start(BundleContext context) { - activator= this; - } - - @Override - public void stop(BundleContext context) { - activator= null; - if (executor != null) { - executor.shutdownNow(); - executor= null; - } + private Activator() { } public static ExecutorService getExecutor() { - activator.createExecutor(); - return activator.executor; + return Holder.EXECUTOR; } - private void createExecutor() { - if (activator.executor != null) { - return; - } - - executor= new ThreadPoolExecutor( + private static final class Holder { + static final ExecutorService EXECUTOR= new ThreadPoolExecutor( Runtime.getRuntime().availableProcessors(), Runtime.getRuntime().availableProcessors(), 3L, TimeUnit.SECONDS,