Community
Participate
Working Groups
DefaultPreferences trim()s the default value of preferences. This means it's impossible to set a product default which ends in a new-line, say. This is important as some prefs (such as auto-generated comments, commands to be run, etc.) are whitespace sensitive. So while it's possible to represent these preference values as Instance prefs, setting them as default doesn't work... DefaultPreferences.translatePreference(String, Properties) line: 384 DefaultPreferences.applyDefaults(String, Properties, Properties) line: 144 DefaultPreferences.applyProductDefaults() line: 198 DefaultPreferences.load() line: 242 DefaultPreferences(EclipsePreferences).create(EclipsePreferences, String, Object) line: 308 DefaultPreferences(EclipsePreferences).internalNode(String, boolean, Object) line: 544 DefaultPreferences(EclipsePreferences).node(String) line: 670 DefaultScope(AbstractScope).getNode(String) line: 38 DefaultScope.getNode(String) line: 76 ScopedPreferenceStore.getDefaultPreferences() line: 250 ScopedPreferenceStore.getPreferenceNodes(boolean) line: 285
Fixed in master. http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=6161803d12b9467209937574538ebb2abe36e986
Thanks DJ! Possible issue: there seems to be some logic which looks for whitespace later on: int ix = value.indexOf(" "); //$NON-NLS-1$ Could this now go wrong? Perhaps a safer bet would be: String retVal = value.trim(); ... existing logic uses retVal ... // fallback return value;
Hmm... yep good catch. I did some tests with spaces but didn't go into the loop.
Ok, I've released that change but it still doesn't quite work if we have a substitution with whitespace at the end of the default value. But considering no one has complained about it yet and I can't find the doc spec'ing what that would look like, I think we're ok for now.