Skip to content

Commit 4cc1642

Browse files
author
kasemir
committed
Simplify locking
1 parent 7e174e7 commit 4cc1642

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/framework/src/main/java/org/phoebus/framework/preferences/InMemoryPreferences.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
*******************************************************************************/
88
package org.phoebus.framework.preferences;
99

10-
import java.util.concurrent.ConcurrentHashMap;
10+
import java.util.HashMap;
11+
import java.util.Map;
1112
import java.util.prefs.AbstractPreferences;
1213
import java.util.prefs.BackingStoreException;
1314
import java.util.prefs.Preferences;
@@ -21,8 +22,12 @@ class InMemoryPreferences extends AbstractPreferences
2122
private static final InMemoryPreferences prefs = new InMemoryPreferences(null, "");
2223

2324
/** Settings for this node in the preferences hierarchy */
24-
private ConcurrentHashMap<String, String> cache = new ConcurrentHashMap<>();
25+
private Map<String, String> cache = new HashMap<>();
2526

27+
// Javadoc for all ..Spi calls includes
28+
// "This method is invoked with the lock on this node held."
29+
// so no need for ConcurrentHashMap or our own locking
30+
2631
/** @return User preferences */
2732
public static Preferences getUserRoot()
2833
{

0 commit comments

Comments
 (0)