src/share/classes/java/util/prefs/AbstractPreferences.java

Print this page
rev 3186 : 6880112: Project Coin: Port JDK core library code to use diamond operator

*** 154,164 **** /** * All known unremoved children of this node. (This "cache" is consulted * prior to calling childSpi() or getChild(). */ private Map<String, AbstractPreferences> kidCache ! = new HashMap<String, AbstractPreferences>(); /** * This field is used to keep track of whether or not this node has * been removed. Once it's set to true, it will never be reset to false. */ --- 154,164 ---- /** * All known unremoved children of this node. (This "cache" is consulted * prior to calling childSpi() or getChild(). */ private Map<String, AbstractPreferences> kidCache ! = new HashMap<>(); /** * This field is used to keep track of whether or not this node has * been removed. Once it's set to true, it will never be reset to false. */
*** 711,721 **** public String[] childrenNames() throws BackingStoreException { synchronized(lock) { if (removed) throw new IllegalStateException("Node has been removed."); ! Set<String> s = new TreeSet<String>(kidCache.keySet()); for (String kid : childrenNamesSpi()) s.add(kid); return s.toArray(EMPTY_STRING_ARRAY); } } --- 711,721 ---- public String[] childrenNames() throws BackingStoreException { synchronized(lock) { if (removed) throw new IllegalStateException("Node has been removed."); ! Set<String> s = new TreeSet<>(kidCache.keySet()); for (String kid : childrenNamesSpi()) s.add(kid); return s.toArray(EMPTY_STRING_ARRAY); } }
*** 1441,1451 **** * thread waits on this queue and delivers the events. This decouples * event delivery from preference activity, greatly simplifying * locking and reducing opportunity for deadlock. */ private static final List<EventObject> eventQueue ! = new LinkedList<EventObject>(); /** * These two classes are used to distinguish NodeChangeEvents on * eventQueue so the event dispatch thread knows whether to call * childAdded or childRemoved. --- 1441,1451 ---- * thread waits on this queue and delivers the events. This decouples * event delivery from preference activity, greatly simplifying * locking and reducing opportunity for deadlock. */ private static final List<EventObject> eventQueue ! = new LinkedList<>(); /** * These two classes are used to distinguish NodeChangeEvents on * eventQueue so the event dispatch thread knows whether to call * childAdded or childRemoved.