Skip to content

Commit

Permalink
Remove now unnecessary calls to String.intern() in PreferencesService
Browse files Browse the repository at this point in the history
The preference keys on which String.intern() is called are already
interned when they are put into the EclipsePreferences object since
#33
  • Loading branch information
HannesWell committed Dec 23, 2023
1 parent 9eae0f7 commit 92a247f
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ public IStatus applyPreferences(IExportedPreferences preferences) throws CoreExc
// preferences that are not in the applied node
// will be removed
propsToRemove.remove(key);
// intern strings we import because some people
// in their property change listeners use identity
// instead of equals. See bug 20193 and 20534.
key = key.intern();
String value = node.get(key, null);
if (value != null) {
if (EclipsePreferences.DEBUG_PREFERENCE_SET) {
Expand All @@ -150,7 +146,6 @@ public IStatus applyPreferences(IExportedPreferences preferences) throws CoreExc
}
}
for (String keyToRemove : propsToRemove) {
keyToRemove = keyToRemove.intern();
if (EclipsePreferences.DEBUG_PREFERENCE_SET) {
PrefsMessages.message("Removing: " + globalNode.absolutePath() + '/' + keyToRemove); //$NON-NLS-1$
}
Expand Down

0 comments on commit 92a247f

Please sign in to comment.