Bug 511138 - Some preference customizations are ignored

Revert "Bug 387898 - Wrong preference node created when starting org.eclipse.jdt.debug.ui plugin"

This reverts commit 92ae5195ee7a7685524798f74948b8fcbfeb7ccd.

Change-Id: I649d614db68c6f51d2d57aa002db5c2984d79345
Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
diff --git a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/DefaultPreferences.java b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/DefaultPreferences.java
index e117222..e707bfc 100644
--- a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/DefaultPreferences.java
+++ b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/DefaultPreferences.java
@@ -170,23 +170,7 @@
 		// if the node already exists, nothing more to do
 		if (super.nodeExists(path))
 			return true;
-
-		// try to apply runtime defaults in case the node is created programmatically inside initializer
-		PreferencesService.getDefault().applyRuntimeDefaults(path, pluginReference);
-		// check if the node was created inside initializer's code
-		if (super.nodeExists(path))
-			return true;
-
-		// try to look for preferences.ini file inside bundle
-		Bundle bundle = PreferencesOSGiUtils.getDefault().getBundle(path);
-		if (bundle != null) {
-			URL url = FileLocator.find(bundle, new Path(IPreferencesConstants.PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME), null);
-			// node exists only if file exists and if it contains some preferences
-			if (!loadProperties(url).isEmpty())
-				return true;
-		}
-
-		// check product and command line customizations
+		// if the node does not exist, maybe it has not been loaded yet
 		initializeCustomizations();
 		// scope based path is a path relative to the "/default" node; this is the path that appears in customizations
 		IPath scopeBasedPath = new Path(absolutePath() + PATH_SEPARATOR + path).removeFirstSegments(1);
diff --git a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java
index 8e89785..e9559a1 100644
--- a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java
+++ b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java
@@ -605,21 +605,19 @@
 							Preferences node = context.getNode(qualifier);
 							if (node != null) {
 								found = true;
-								if (childPath != null && node.nodeExists(childPath))
+								if (childPath != null)
 									node = node.node(childPath);
 								result.add(node);
 							}
 						}
 					}
 					if (!found) {
-						Preferences node = getRootNode().node(scopeString);
-						if (node.nodeExists(qualifier)) {
-							node = node.node(qualifier);
-							if (childPath != null && node.nodeExists(childPath))
-								node = node.node(childPath);
-							result.add(node);
-						}
+						Preferences node = getRootNode().node(scopeString).node(qualifier);
+						if (childPath != null)
+							node = node.node(childPath);
+						result.add(node);
 					}
+					found = false;
 				}
 
 				@Override