aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2012-03-08 08:58:33 (EST)
committerThomas Watson2012-03-08 08:58:33 (EST)
commite545f5e1428338ed3c28686ee22186898eca0a55 (patch)
tree96f27914d44acee88f4c66701c7c7a84d4eddc8e
parent47f021c0ec945529add384c6b2d153caf027792d (diff)
downloadrt.equinox.framework-e545f5e1428338ed3c28686ee22186898eca0a55.zip
rt.equinox.framework-e545f5e1428338ed3c28686ee22186898eca0a55.tar.gz
rt.equinox.framework-e545f5e1428338ed3c28686ee22186898eca0a55.tar.bz2
Bug 373640 - NPE in launcher introduced by bug 241192v20120308-1358
The loadConfiguration method is allowed to return null, so the substituteVars(Properties) invoked as a last instruction inside the loadConfiguration method must be able to handle null properties properly.
-rw-r--r--bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java5
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java4
2 files changed, 9 insertions, 0 deletions
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 fe2bf1e..6a51e42 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
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Anton Leherbauer (Wind River Systems) - bug 301226
+ * Red Hat Inc. - bug 373640
*******************************************************************************/
package org.eclipse.equinox.launcher;
@@ -2704,6 +2705,10 @@ public class Main {
}
private Properties substituteVars(Properties result) {
+ if (result == null) {
+ //nothing todo.
+ return null;
+ }
for (Enumeration eKeys = result.keys(); eKeys.hasMoreElements();) {
Object key = eKeys.nextElement();
if (key instanceof String) {
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
index 9c2f824..5783d5a 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
@@ -1159,6 +1159,10 @@ public class EclipseStarter {
}
private static Properties substituteVars(Properties result) {
+ if (result == null) {
+ //nothing todo.
+ return null;
+ }
for (Enumeration<Object> eKeys = result.keys(); eKeys.hasMoreElements();) {
Object key = eKeys.nextElement();
if (key instanceof String) {