--- old/src/share/classes/java/io/ObjectStreamClass.java 2010-12-15 14:40:19.023684946 -0800 +++ new/src/share/classes/java/io/ObjectStreamClass.java 2010-12-15 14:40:18.783328926 -0800 @@ -84,18 +84,18 @@ private static class Caches { /** cache mapping local classes -> descriptors */ static final ConcurrentMap> localDescs = - new ConcurrentHashMap>(); + new ConcurrentHashMap<>(); /** cache mapping field group/local desc pairs -> field reflectors */ static final ConcurrentMap> reflectors = - new ConcurrentHashMap>(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to local classes */ private static final ReferenceQueue> localDescsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); /** queue for WeakReferences to field reflectors keys */ private static final ReferenceQueue> reflectorsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** class associated with this descriptor (if any) */ @@ -290,7 +290,7 @@ EntryFuture future = null; if (entry == null) { EntryFuture newEntry = new EntryFuture(); - Reference newRef = new SoftReference(newEntry); + Reference newRef = new SoftReference<>(newEntry); do { if (ref != null) { Caches.localDescs.remove(key, ref); @@ -329,7 +329,7 @@ entry = th; } if (future.set(entry)) { - Caches.localDescs.put(key, new SoftReference(entry)); + Caches.localDescs.put(key, new SoftReference<>(entry)); } else { // nested lookup call already set future entry = future.get(); @@ -1130,7 +1130,7 @@ private ClassDataSlot[] getClassDataLayout0() throws InvalidClassException { - ArrayList slots = new ArrayList(); + ArrayList slots = new ArrayList<>(); Class start = cl, end = cl; // locate closest non-serializable superclass @@ -1566,7 +1566,7 @@ ObjectStreamField[] boundFields = new ObjectStreamField[serialPersistentFields.length]; - Set fieldNames = new HashSet(serialPersistentFields.length); + Set fieldNames = new HashSet<>(serialPersistentFields.length); for (int i = 0; i < serialPersistentFields.length; i++) { ObjectStreamField spf = serialPersistentFields[i]; @@ -1604,7 +1604,7 @@ */ private static ObjectStreamField[] getDefaultSerialFields(Class cl) { Field[] clFields = cl.getDeclaredFields(); - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); int mask = Modifier.STATIC | Modifier.TRANSIENT; for (int i = 0; i < clFields.length; i++) { @@ -1855,8 +1855,8 @@ writeKeys = new long[nfields]; offsets = new int[nfields]; typeCodes = new char[nfields]; - ArrayList> typeList = new ArrayList>(); - Set usedKeys = new HashSet(); + ArrayList> typeList = new ArrayList<>(); + Set usedKeys = new HashSet<>(); for (int i = 0; i < nfields; i++) { @@ -2092,7 +2092,7 @@ EntryFuture future = null; if (entry == null) { EntryFuture newEntry = new EntryFuture(); - Reference newRef = new SoftReference(newEntry); + Reference newRef = new SoftReference<>(newEntry); do { if (ref != null) { Caches.reflectors.remove(key, ref); @@ -2118,7 +2118,7 @@ entry = th; } future.set(entry); - Caches.reflectors.put(key, new SoftReference(entry)); + Caches.reflectors.put(key, new SoftReference<>(entry)); } if (entry instanceof FieldReflector) {