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,11 +154,11 @@
/**
* 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>();
+ = 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,11 +711,11 @@
public String[] childrenNames() throws BackingStoreException {
synchronized(lock) {
if (removed)
throw new IllegalStateException("Node has been removed.");
- Set<String> s = new TreeSet<String>(kidCache.keySet());
+ Set<String> s = new TreeSet<>(kidCache.keySet());
for (String kid : childrenNamesSpi())
s.add(kid);
return s.toArray(EMPTY_STRING_ARRAY);
}
}
@@ -1441,11 +1441,11 @@
* 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>();
+ = new LinkedList<>();
/**
* These two classes are used to distinguish NodeChangeEvents on
* eventQueue so the event dispatch thread knows whether to call
* childAdded or childRemoved.