From 84e4230f3155b8e33333022aef12968341390f3a Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Fri, 30 Nov 2007 17:57:36 +0000 Subject: [PATCH] [211534] Changed the constructor of the singleton class to private (try #2). --- .../eclipse/dd/dsf/concurrent/ImmediateExecutor.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/concurrent/ImmediateExecutor.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/concurrent/ImmediateExecutor.java index 9b97db6b81a..64316554eff 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/concurrent/ImmediateExecutor.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/concurrent/ImmediateExecutor.java @@ -19,9 +19,19 @@ import java.util.concurrent.Executor; * @see RequestMonitor */ public class ImmediateExecutor implements Executor { + private static ImmediateExecutor fInstance = new ImmediateExecutor(); - private static Executor getInstance() { + /** + * The default constructor is hidden. {@link #getInstance()} should be + * used instead. + */ + private ImmediateExecutor() {} + + /** + * Returns the singleton instance of ImmediateExecutor. + */ + public static Executor getInstance() { return fInstance; }