Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2013-04-19 20:01:06 +0000
committerJohn Arthorne2013-04-19 20:01:06 +0000
commit33bded3189adb9810027a79370e5d27e0697188d (patch)
treedae5feab6283c8f3140a75875fa04fac6ec582d3
parent35c064f61326fcc57f1fa4e8ec8103128046bb2c (diff)
downloadrt.equinox.bundles-33bded3189adb9810027a79370e5d27e0697188d.tar.gz
rt.equinox.bundles-33bded3189adb9810027a79370e5d27e0697188d.tar.xz
rt.equinox.bundles-33bded3189adb9810027a79370e5d27e0697188d.zip
Bug 380859 - [prefs] Inconsistency between DefaultPreferences Vs
InstancePreferences
-rw-r--r--bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/DefaultPreferences.java16
1 files changed, 10 insertions, 6 deletions
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 ed6a3d79b..94c9baf0a 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
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Gunnar Wagenknecht - Bug 179695 - [prefs] NPE when using Preferences API without a product
+ * Thirumala Reddy Mutchukota, Google Inc - Bug 380859 - [prefs] Inconsistency between DefaultPreferences and InstancePreferences
*******************************************************************************/
package org.eclipse.core.internal.preferences;
@@ -122,14 +123,17 @@ public class DefaultPreferences extends EclipsePreferences {
String value = defaultValues.getProperty(fullKey);
if (value == null)
continue;
- IPath childPath = new Path(fullKey);
- String key = childPath.lastSegment();
- childPath = childPath.removeLastSegments(1);
String localQualifier = id;
- if (id == null) {
- localQualifier = childPath.segment(0);
- childPath = childPath.removeFirstSegments(1);
+ String fullPath = fullKey;
+ int firstIndex = fullKey.indexOf(PATH_SEPARATOR);
+ if (id == null && firstIndex > 0) {
+ localQualifier = fullKey.substring(0, firstIndex);
+ fullPath = fullKey.substring(firstIndex, fullKey.length());
}
+ String[] splitPath = decodePath(fullPath);
+ String childPath = splitPath[0];
+ childPath = makeRelative(childPath);
+ String key = splitPath[1];
if (name().equals(localQualifier)) {
value = translatePreference(value, translations);
if (EclipsePreferences.DEBUG_PREFERENCE_SET)

Back to the top