Bug 430798 - Inability to distinguish and investigate an Equinox restart
request when using -noExit
diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
index 8a299c4..d9e8f3a 100644
--- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
+++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
@@ -1441,7 +1441,10 @@
// In case something weird happens, just dump stack - logging is not available at this point
t.printStackTrace();
} finally {
- if (!Boolean.getBoolean(PROP_NOSHUTDOWN))
+ // If the return code is 23, that means that Equinox requested a restart.
+ // In order to distinguish the request for a restart, do a System.exit(23)
+ // no matter of 'osgi.noShutdown' runtime property value.
+ if (!Boolean.getBoolean(PROP_NOSHUTDOWN) || result == 23)
// make sure we always terminate the VM
System.exit(result);
}