Skip to content

Commit c82679b

Browse files
author
Jörg Kubitz
committed
Fix "The application has not been initialized." after shutdown
to "The application is already stopped." As seen logged at the end of many junit tests.
1 parent 31bb835 commit c82679b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public final class InternalPlatform {
102102

103103
private boolean splashEnded = false;
104104
private volatile boolean initialized;
105+
private volatile boolean stopped;
105106
private static final String KEYRING = "-keyring"; //$NON-NLS-1$
106107
private String keyringFile;
107108

@@ -182,8 +183,13 @@ public void addLogListener(ILogListener listener) {
182183

183184
private void assertInitialized() {
184185
//avoid the Policy.bind if assertion is true
185-
if (!initialized)
186-
Assert.isTrue(false, Messages.meta_appNotInit);
186+
if (!initialized) {
187+
if (stopped) {
188+
Assert.isTrue(false, "The application is already stopped."); //$NON-NLS-1$
189+
} else {
190+
Assert.isTrue(false, Messages.meta_appNotInit);
191+
}
192+
}
187193
}
188194

189195
/**
@@ -692,6 +698,7 @@ public void stop(BundleContext bundleContext) {
692698
initialized = false;
693699
closeOSGITrackers();
694700
context = null;
701+
stopped = true;
695702
}
696703

697704
private void openOSGiTrackers() {

0 commit comments

Comments
 (0)