Skip to content

Commit

Permalink
EclipsePreferences: intern() keys and values
Browse files Browse the repository at this point in the history
removes all duplicate Strings from
JavaModelManager.PerProjectInfo.options

eclipse-jdt/eclipse.jdt.core#1692
  • Loading branch information
EcljpseB0T committed Dec 5, 2023
1 parent 9cc56cc commit 2325abe
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,11 @@ protected IEclipsePreferences internalNode(String path, boolean notify, Object c
* null if no value existed.
*/
protected String internalPut(String key, String newValue) {
// intern the Strings to save memory
// shareStrings() comes too late,
// when plugins may have already copied preferences
newValue = newValue.intern();
key = key.intern();
synchronized (childAndPropertyLock) {
// illegal state if this node has been removed
checkRemoved();
Expand Down

0 comments on commit 2325abe

Please sign in to comment.