diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java index 80c256d3b2f..f3a009455d2 100644 --- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java +++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java @@ -102,6 +102,7 @@ public final class InternalPlatform { private boolean splashEnded = false; private volatile boolean initialized; + private volatile boolean stopped; private static final String KEYRING = "-keyring"; //$NON-NLS-1$ private String keyringFile; @@ -182,8 +183,13 @@ public void addLogListener(ILogListener listener) { private void assertInitialized() { //avoid the Policy.bind if assertion is true - if (!initialized) - Assert.isTrue(false, Messages.meta_appNotInit); + if (!initialized) { + if (stopped) { + Assert.isTrue(false, Messages.meta_appStopped); + } else { + Assert.isTrue(false, Messages.meta_appNotInit); + } + } } /** @@ -677,6 +683,7 @@ public void start(BundleContext runtimeContext) { processCommandLine(getEnvironmentInfoService().getNonFrameworkArgs()); initializeDebugFlags(); initialized = true; + stopped = false; initializeAuthorizationHandler(); startServices(); } @@ -691,6 +698,7 @@ public void stop(BundleContext bundleContext) { stopServices(); // should be done after preferences shutdown initialized = false; closeOSGITrackers(); + stopped = true; context = null; } diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Messages.java b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Messages.java index 0e2008f7030..f2985eae785 100644 --- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Messages.java +++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Messages.java @@ -29,7 +29,9 @@ public class Messages extends NLS { // metadata public static String meta_appNotInit; + public static String meta_appStopped; public static String meta_exceptionParsingLog; + // parsing/resolve public static String plugin_deactivatedLoad; diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties index aa073a1deaa..ccdc742e5a8 100644 --- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties +++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/messages.properties @@ -19,6 +19,7 @@ auth_notAvailable = Authorization infrastructure (org.eclipse.core.runtime.compa ### metadata meta_appNotInit = The application has not been initialized. +meta_appStopped=The application is already stopped. meta_exceptionParsingLog = An exception occurred while parsing the log file: {0} ### plugins