--- old/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java 2010-12-15 14:40:09.187435425 -0800 +++ new/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java 2010-12-15 14:40:08.955476261 -0800 @@ -1704,7 +1704,7 @@ for (int i = 0; i < ATTR_CONTEXT_LIMIT; i++) { assert(attrIndexLimit[i] == 0); attrIndexLimit[i] = 32; // just for the sake of predefs. - attrDefs.set(i, new ArrayList(Collections.nCopies( + attrDefs.set(i, new ArrayList<>(Collections.nCopies( attrIndexLimit[i], (Attribute.Layout)null))); } --- old/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2010-12-15 14:40:10.179402558 -0800 +++ new/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java 2010-12-15 14:40:09.955296632 -0800 @@ -1137,7 +1137,7 @@ void completeReferencesIn(Set cpRefs, boolean flattenSigs) { cpRefs.remove(null); for (ListIterator work = - new ArrayList(cpRefs).listIterator(cpRefs.size()); + new ArrayList<>(cpRefs).listIterator(cpRefs.size()); work.hasPrevious(); ) { Entry e = work.previous(); work.remove(); // pop stack --- old/src/share/classes/com/sun/java/util/jar/pack/Package.java 2010-12-15 14:40:11.151359878 -0800 +++ new/src/share/classes/com/sun/java/util/jar/pack/Package.java 2010-12-15 14:40:10.919287858 -0800 @@ -322,7 +322,7 @@ } public void setInnerClasses(Collection ics) { - innerClasses = (ics == null) ? null : new ArrayList(ics); + innerClasses = (ics == null) ? null : new ArrayList<>(ics); // Edit the attribute list, if necessary. Attribute a = getAttribute(attrInnerClassesEmpty); if (innerClasses != null && a == null) --- old/src/share/classes/java/io/DeleteOnExitHook.java 2010-12-15 14:40:12.099774533 -0800 +++ new/src/share/classes/java/io/DeleteOnExitHook.java 2010-12-15 14:40:11.871299626 -0800 @@ -34,7 +34,7 @@ */ class DeleteOnExitHook { - private static LinkedHashSet files = new LinkedHashSet(); + private static LinkedHashSet files = new LinkedHashSet<>(); static { // DeleteOnExitHook must be the last shutdown hook to be invoked. // Application shutdown hooks may add the first file to the @@ -71,7 +71,7 @@ files = null; } - ArrayList toBeDeleted = new ArrayList(theFiles); + ArrayList toBeDeleted = new ArrayList<>(theFiles); // reverse the list to maintain previous jdk deletion order. // Last in first deleted. --- old/src/share/classes/java/io/File.java 2010-12-15 14:40:13.028023768 -0800 +++ new/src/share/classes/java/io/File.java 2010-12-15 14:40:12.799457796 -0800 @@ -1067,7 +1067,7 @@ if ((names == null) || (filter == null)) { return names; } - List v = new ArrayList(); + List v = new ArrayList<>(); for (int i = 0 ; i < names.length ; i++) { if (filter.accept(this, names[i])) { v.add(names[i]); @@ -1158,7 +1158,7 @@ public File[] listFiles(FilenameFilter filter) { String ss[] = list(); if (ss == null) return null; - ArrayList files = new ArrayList(); + ArrayList files = new ArrayList<>(); for (String s : ss) if ((filter == null) || filter.accept(this, s)) files.add(new File(s, this)); @@ -1195,7 +1195,7 @@ public File[] listFiles(FileFilter filter) { String ss[] = list(); if (ss == null) return null; - ArrayList files = new ArrayList(); + ArrayList files = new ArrayList<>(); for (String s : ss) { File f = new File(s, this); if ((filter == null) || filter.accept(f)) --- old/src/share/classes/java/io/FileInputStream.java 2010-12-15 14:40:14.023798647 -0800 +++ new/src/share/classes/java/io/FileInputStream.java 2010-12-15 14:40:13.787292560 -0800 @@ -56,7 +56,7 @@ private volatile boolean closed = false; private static final ThreadLocal runningFinalize = - new ThreadLocal(); + new ThreadLocal<>(); private static boolean isRunningFinalize() { Boolean val; --- old/src/share/classes/java/io/FileOutputStream.java 2010-12-15 14:40:15.003307771 -0800 +++ new/src/share/classes/java/io/FileOutputStream.java 2010-12-15 14:40:14.775647781 -0800 @@ -69,7 +69,7 @@ private final Object closeLock = new Object(); private volatile boolean closed = false; private static final ThreadLocal runningFinalize = - new ThreadLocal(); + new ThreadLocal<>(); private static boolean isRunningFinalize() { Boolean val; --- old/src/share/classes/java/io/FilePermission.java 2010-12-15 14:40:15.951368198 -0800 +++ new/src/share/classes/java/io/FilePermission.java 2010-12-15 14:40:15.727545004 -0800 @@ -725,7 +725,7 @@ */ public FilePermissionCollection() { - perms = new ArrayList(); + perms = new ArrayList<>(); } /** @@ -830,7 +830,7 @@ // Don't call out.defaultWriteObject() // Write out Vector - Vector permissions = new Vector(perms.size()); + Vector permissions = new Vector<>(perms.size()); synchronized (this) { permissions.addAll(perms); } @@ -853,7 +853,7 @@ // Get the one we want Vector permissions = (Vector)gfields.get("permissions", null); - perms = new ArrayList(permissions.size()); + perms = new ArrayList<>(permissions.size()); perms.addAll(permissions); } } --- old/src/share/classes/java/io/ObjectInputStream.java 2010-12-15 14:40:16.920538855 -0800 +++ new/src/share/classes/java/io/ObjectInputStream.java 2010-12-15 14:40:16.691513878 -0800 @@ -213,7 +213,7 @@ /** table mapping primitive type names to corresponding class objects */ private static final HashMap> primClasses - = new HashMap>(8, 1.0F); + = new HashMap<>(8, 1.0F); static { primClasses.put("boolean", boolean.class); primClasses.put("byte", byte.class); @@ -229,11 +229,11 @@ private static class Caches { /** cache of subclass security audit results */ static final ConcurrentMap subclassAudits = - new ConcurrentHashMap(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to audited subclasses */ static final ReferenceQueue> subclassAuditsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** filter stream for handling block data conversion */ --- old/src/share/classes/java/io/ObjectOutputStream.java 2010-12-15 14:40:17.968072000 -0800 +++ new/src/share/classes/java/io/ObjectOutputStream.java 2010-12-15 14:40:17.719286969 -0800 @@ -165,11 +165,11 @@ private static class Caches { /** cache of subclass security audit results */ static final ConcurrentMap subclassAudits = - new ConcurrentHashMap(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to audited subclasses */ static final ReferenceQueue> subclassAuditsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** filter stream for handling block data conversion */ @@ -2413,7 +2413,7 @@ private final List stack; DebugTraceInfoStack() { - stack = new ArrayList(); + stack = new ArrayList<>(); } /** --- 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) { --- old/src/share/classes/java/lang/ApplicationShutdownHooks.java 2010-12-15 14:40:20.179828307 -0800 +++ new/src/share/classes/java/lang/ApplicationShutdownHooks.java 2010-12-15 14:40:19.849274195 -0800 @@ -47,7 +47,7 @@ } } ); - hooks = new IdentityHashMap(); + hooks = new IdentityHashMap<>(); } catch (IllegalStateException e) { // application shutdown hooks cannot be added if // shutdown is in progress. --- old/src/share/classes/java/lang/Character.java 2010-12-15 14:40:21.143821768 -0800 +++ new/src/share/classes/java/lang/Character.java 2010-12-15 14:40:20.915294892 -0800 @@ -649,7 +649,7 @@ public static final class UnicodeBlock extends Subset { private static Map map - = new HashMap(256); + = new HashMap<>(256); /** * Creates a UnicodeBlock with the given identifier name. @@ -4178,7 +4178,7 @@ private static HashMap aliases; static { - aliases = new HashMap(128); + aliases = new HashMap<>(128); aliases.put("ARAB", ARABIC); aliases.put("ARMI", IMPERIAL_ARAMAIC); aliases.put("ARMN", ARMENIAN); --- old/src/share/classes/java/lang/CharacterName.java 2010-12-15 14:40:22.243833114 -0800 +++ new/src/share/classes/java/lang/CharacterName.java 2010-12-15 14:40:22.019290252 -0800 @@ -81,7 +81,7 @@ } while (cpOff < cpEnd); strPool = new byte[total - cpEnd]; dis.readFully(strPool); - refStrPool = new SoftReference(strPool); + refStrPool = new SoftReference<>(strPool); } catch (Exception x) { throw new InternalError(x.getMessage()); } finally { --- old/src/share/classes/java/lang/Class.java 2010-12-15 14:40:23.256152835 -0800 +++ new/src/share/classes/java/lang/Class.java 2010-12-15 14:40:23.050477742 -0800 @@ -1306,7 +1306,7 @@ return java.security.AccessController.doPrivileged( new java.security.PrivilegedAction[]>() { public Class[] run() { - List> list = new ArrayList>(); + List> list = new ArrayList<>(); Class currentClass = Class.this; while (currentClass != null) { Class[] members = currentClass.getDeclaredClasses(); @@ -2306,9 +2306,9 @@ res = Reflection.filterFields(this, getDeclaredFields0(publicOnly)); if (useCaches) { if (publicOnly) { - declaredPublicFields = new SoftReference(res); + declaredPublicFields = new SoftReference<>(res); } else { - declaredFields = new SoftReference(res); + declaredFields = new SoftReference<>(res); } } return res; @@ -2330,9 +2330,9 @@ // No cached value available; compute value recursively. // Traverse in correct order for getField(). - List fields = new ArrayList(); + List fields = new ArrayList<>(); if (traversedInterfaces == null) { - traversedInterfaces = new HashSet>(); + traversedInterfaces = new HashSet<>(); } // Local fields @@ -2358,7 +2358,7 @@ res = new Field[fields.size()]; fields.toArray(res); if (useCaches) { - publicFields = new SoftReference(res); + publicFields = new SoftReference<>(res); } return res; } @@ -2403,9 +2403,9 @@ } if (useCaches) { if (publicOnly) { - publicConstructors = new SoftReference[]>(res); + publicConstructors = new SoftReference<>(res); } else { - declaredConstructors = new SoftReference[]>(res); + declaredConstructors = new SoftReference<>(res); } } return res; @@ -2440,9 +2440,9 @@ res = Reflection.filterMethods(this, getDeclaredMethods0(publicOnly)); if (useCaches) { if (publicOnly) { - declaredPublicMethods = new SoftReference(res); + declaredPublicMethods = new SoftReference<>(res); } else { - declaredMethods = new SoftReference(res); + declaredMethods = new SoftReference<>(res); } } return res; @@ -2598,7 +2598,7 @@ methods.compactAndTrim(); res = methods.getArray(); if (useCaches) { - publicMethods = new SoftReference(res); + publicMethods = new SoftReference<>(res); } return res; } @@ -2977,7 +2977,7 @@ if (universe == null) throw new IllegalArgumentException( getName() + " is not an enum type"); - Map m = new HashMap(2 * universe.length); + Map m = new HashMap<>(2 * universe.length); for (T constant : universe) m.put(((Enum)constant).name(), constant); enumConstantDirectory = m; @@ -3090,7 +3090,7 @@ if (superClass == null) { annotations = declaredAnnotations; } else { - annotations = new HashMap, Annotation>(); + annotations = new HashMap<>(); superClass.initAnnotationsIfNecessary(); for (Map.Entry, Annotation> e : superClass.annotations.entrySet()) { Class annotationClass = e.getKey(); --- old/src/share/classes/java/lang/ClassLoader.java 2010-12-15 14:40:24.487289242 -0800 +++ new/src/share/classes/java/lang/ClassLoader.java 2010-12-15 14:40:24.251505308 -0800 @@ -247,7 +247,7 @@ // The classes loaded by this class loader. The only purpose of this table // is to keep the classes from being GC'ed until the loader is GC'ed. - private final Vector> classes = new Vector>(); + private final Vector> classes = new Vector<>(); // The "default" domain. Set as the default ProtectionDomain on newly // created classes. @@ -267,7 +267,7 @@ // to its corresponding Package object. // @GuardedBy("itself") private final HashMap packages = - new HashMap(); + new HashMap<>(); private static Void checkCreateClassLoader() { SecurityManager security = System.getSecurityManager(); @@ -280,16 +280,16 @@ private ClassLoader(Void unused, ClassLoader parent) { this.parent = parent; if (ParallelLoaders.isRegistered(this.getClass())) { - parallelLockMap = new ConcurrentHashMap(); - package2certs = new ConcurrentHashMap(); + parallelLockMap = new ConcurrentHashMap<>(); + package2certs = new ConcurrentHashMap<>(); domains = Collections.synchronizedSet(new HashSet()); assertionLock = new Object(); } else { // no finer-grained lock; lock on the classloader instance parallelLockMap = null; - package2certs = new Hashtable(); - domains = new HashSet(); + package2certs = new Hashtable<>(); + domains = new HashSet<>(); assertionLock = this; } } @@ -1182,7 +1182,7 @@ } tmp[1] = findResources(name); - return new CompoundEnumeration(tmp); + return new CompoundEnumeration<>(tmp); } /** @@ -1657,7 +1657,7 @@ protected Package[] getPackages() { Map map; synchronized (packages) { - map = new HashMap(packages); + map = new HashMap<>(packages); } Package[] pkgs; if (parent != null) { @@ -1765,19 +1765,19 @@ // All native library names we've loaded. private static Vector loadedLibraryNames - = new Vector(); + = new Vector<>(); // Native libraries belonging to system classes. private static Vector systemNativeLibraries - = new Vector(); + = new Vector<>(); // Native libraries associated with the class loader. private Vector nativeLibraries - = new Vector(); + = new Vector<>(); // native libraries being loaded/unloaded. private static Stack nativeLibraryContext - = new Stack(); + = new Stack<>(); // The paths searched for libraries private static String usr_paths[]; @@ -2101,8 +2101,8 @@ * them to empty maps, effectively ignoring any present settings. */ synchronized (assertionLock) { - classAssertionStatus = new HashMap(); - packageAssertionStatus = new HashMap(); + classAssertionStatus = new HashMap<>(); + packageAssertionStatus = new HashMap<>(); defaultAssertionStatus = false; } } @@ -2164,8 +2164,8 @@ private void initializeJavaAssertionMaps() { // assert Thread.holdsLock(assertionLock); - classAssertionStatus = new HashMap(); - packageAssertionStatus = new HashMap(); + classAssertionStatus = new HashMap<>(); + packageAssertionStatus = new HashMap<>(); AssertionStatusDirectives directives = retrieveDirectives(); for(int i = 0; i < directives.classes.length; i++) --- old/src/share/classes/java/lang/Package.java 2010-12-15 14:40:25.487821999 -0800 +++ new/src/share/classes/java/lang/Package.java 2010-12-15 14:40:25.251368428 -0800 @@ -589,15 +589,15 @@ // The map of loaded system packages private static Map pkgs - = new HashMap(31); + = new HashMap<>(31); // Maps each directory or zip file name to its corresponding url private static Map urls - = new HashMap(10); + = new HashMap<>(10); // Maps each code source url for a jar file to its manifest private static Map mans - = new HashMap(10); + = new HashMap<>(10); private static native String getSystemPackage0(String name); private static native String[] getSystemPackages0(); --- old/src/share/classes/java/lang/ProcessBuilder.java 2010-12-15 14:40:26.407639168 -0800 +++ new/src/share/classes/java/lang/ProcessBuilder.java 2010-12-15 14:40:26.183472070 -0800 @@ -214,7 +214,7 @@ * @param command a string array containing the program and its arguments */ public ProcessBuilder(String... command) { - this.command = new ArrayList(command.length); + this.command = new ArrayList<>(command.length); for (String arg : command) this.command.add(arg); } @@ -251,7 +251,7 @@ * @return this process builder */ public ProcessBuilder command(String... command) { - this.command = new ArrayList(command.length); + this.command = new ArrayList<>(command.length); for (String arg : command) this.command.add(arg); return this; --- old/src/share/classes/java/lang/String.java 2010-12-15 14:40:27.420527401 -0800 +++ new/src/share/classes/java/lang/String.java 2010-12-15 14:40:27.203376561 -0800 @@ -2330,7 +2330,7 @@ int off = 0; int next = 0; boolean limited = limit > 0; - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); while ((next = indexOf(ch, off)) != -1) { if (!limited || list.size() < limit - 1) { list.add(substring(off, next)); --- old/src/share/classes/java/lang/StringCoding.java 2010-12-15 14:40:28.547391308 -0800 +++ new/src/share/classes/java/lang/StringCoding.java 2010-12-15 14:40:28.331339216 -0800 @@ -53,9 +53,9 @@ /** The cached coders for each thread */ private final static ThreadLocal> decoder = - new ThreadLocal>(); + new ThreadLocal<>(); private final static ThreadLocal> encoder = - new ThreadLocal>(); + new ThreadLocal<>(); private static boolean warnUnsupportedCharset = true; @@ -67,7 +67,7 @@ } private static void set(ThreadLocal> tl, T ob) { - tl.set(new SoftReference(ob)); + tl.set(new SoftReference<>(ob)); } // Trim the given byte array to the given length --- old/src/share/classes/java/lang/Thread.java 2010-12-15 14:40:29.504183577 -0800 +++ new/src/share/classes/java/lang/Thread.java 2010-12-15 14:40:29.279331486 -0800 @@ -1643,7 +1643,7 @@ Thread[] threads = getThreads(); StackTraceElement[][] traces = dumpThreads(threads); Map m - = new HashMap(threads.length); + = new HashMap<>(threads.length); for (int i = 0; i < threads.length; i++) { StackTraceElement[] stackTrace = traces[i]; if (stackTrace != null) { @@ -1664,11 +1664,11 @@ private static class Caches { /** cache of subclass security audit results */ static final ConcurrentMap subclassAudits = - new ConcurrentHashMap(); + new ConcurrentHashMap<>(); /** queue for WeakReferences to audited subclasses */ static final ReferenceQueue> subclassAuditsQueue = - new ReferenceQueue>(); + new ReferenceQueue<>(); } /** --- old/src/share/classes/java/lang/Throwable.java 2010-12-15 14:40:30.463623110 -0800 +++ new/src/share/classes/java/lang/Throwable.java 2010-12-15 14:40:30.247289139 -0800 @@ -828,7 +828,7 @@ // Use the sentinel for a zero-length list suppressed = SUPPRESSED_SENTINEL; } else { // Copy Throwables to new list - suppressed = new ArrayList(1); + suppressed = new ArrayList<>(1); for (Throwable t : suppressedExceptions) { // Enforce constraints on suppressed exceptions in // case of corrupt or malicious stream. @@ -911,7 +911,7 @@ return; if (suppressedExceptions == SUPPRESSED_SENTINEL) - suppressedExceptions = new ArrayList(1); + suppressedExceptions = new ArrayList<>(1); assert suppressedExceptions != SUPPRESSED_SENTINEL; --- old/src/share/classes/java/lang/management/ManagementFactory.java 2010-12-15 14:40:31.395598529 -0800 +++ new/src/share/classes/java/lang/management/ManagementFactory.java 2010-12-15 14:40:31.175290301 -0800 @@ -794,7 +794,7 @@ */ public static List> getAllPlatformMXBeanInterfaces() { List> result = - new ArrayList>(); + new ArrayList<>(); for (PlatformComponent component: PlatformComponent.values()) { result.add(component.getMXBeanInterface()); } --- old/src/share/classes/java/lang/management/PlatformComponent.java 2010-12-15 14:40:32.340063804 -0800 +++ new/src/share/classes/java/lang/management/PlatformComponent.java 2010-12-15 14:40:32.119289589 -0800 @@ -267,7 +267,7 @@ List getGcMXBeanList(Class gcMXBeanIntf) { List list = ManagementFactoryHelper.getGarbageCollectorMXBeans(); - List result = new ArrayList(list.size()); + List result = new ArrayList<>(list.size()); for (GarbageCollectorMXBean m : list) { if (gcMXBeanIntf.isInstance(m)) { result.add(gcMXBeanIntf.cast(m)); @@ -330,7 +330,7 @@ } private static Set keyProperties(String... keyNames) { - Set set = new HashSet(); + Set set = new HashSet<>(); set.add("type"); for (String s : keyNames) { set.add(s); @@ -364,7 +364,7 @@ List getMXBeans(MBeanServerConnection mbs, Class mxbeanInterface) throws java.io.IOException { - List result = new ArrayList(); + List result = new ArrayList<>(); for (ObjectName on : getObjectNames(mbs)) { result.add(ManagementFactory. newPlatformMXBeanProxy(mbs, --- old/src/share/classes/java/lang/reflect/Constructor.java 2010-12-15 14:40:33.279976542 -0800 +++ new/src/share/classes/java/lang/reflect/Constructor.java 2010-12-15 14:40:33.040143467 -0800 @@ -144,7 +144,7 @@ // which implicitly requires that new java.lang.reflect // objects be fabricated for each reflective call on Class // objects.) - Constructor res = new Constructor(clazz, + Constructor res = new Constructor<>(clazz, parameterTypes, exceptionTypes, modifiers, slot, signature, --- old/src/share/classes/java/lang/reflect/Proxy.java 2010-12-15 14:40:34.247741712 -0800 +++ new/src/share/classes/java/lang/reflect/Proxy.java 2010-12-15 14:40:34.023285733 -0800 @@ -232,7 +232,7 @@ /** maps a class loader to the proxy class cache for that loader */ private static Map, Object>> loaderToCache - = new WeakHashMap, Object>>(); + = new WeakHashMap<>(); /** marks that a particular proxy class is currently being generated */ private static Object pendingGenerationMarker = new Object(); @@ -356,7 +356,7 @@ String[] interfaceNames = new String[interfaces.length]; // for detecting duplicates - Set> interfaceSet = new HashSet>(); + Set> interfaceSet = new HashSet<>(); for (int i = 0; i < interfaces.length; i++) { /* @@ -413,7 +413,7 @@ synchronized (loaderToCache) { cache = loaderToCache.get(loader); if (cache == null) { - cache = new HashMap, Object>(); + cache = new HashMap<>(); loaderToCache.put(loader, cache); } /* --- old/src/share/classes/java/lang/reflect/ReflectAccess.java 2010-12-15 14:40:35.199324371 -0800 +++ new/src/share/classes/java/lang/reflect/ReflectAccess.java 2010-12-15 14:40:34.971390300 -0800 @@ -84,7 +84,7 @@ byte[] annotations, byte[] parameterAnnotations) { - return new Constructor(declaringClass, + return new Constructor<>(declaringClass, parameterTypes, checkedExceptions, modifiers, --- old/src/share/classes/java/sql/DriverManager.java 2010-12-15 14:40:36.115794732 -0800 +++ new/src/share/classes/java/sql/DriverManager.java 2010-12-15 14:40:35.895439570 -0800 @@ -364,7 +364,7 @@ * @return the list of JDBC Drivers loaded by the caller's class loader */ public static java.util.Enumeration getDrivers() { - java.util.Vector result = new java.util.Vector(); + java.util.Vector result = new java.util.Vector<>(); java.util.Vector drivers = null; if (!initialized) { --- old/src/share/classes/java/util/AbstractList.java 2010-12-15 14:40:37.039793983 -0800 +++ new/src/share/classes/java/util/AbstractList.java 2010-12-15 14:40:36.815286907 -0800 @@ -482,8 +482,8 @@ */ public List subList(int fromIndex, int toIndex) { return (this instanceof RandomAccess ? - new RandomAccessSubList(this, fromIndex, toIndex) : - new SubList(this, fromIndex, toIndex)); + new RandomAccessSubList<>(this, fromIndex, toIndex) : + new SubList<>(this, fromIndex, toIndex)); } // Comparison and hashing @@ -747,7 +747,7 @@ } public List subList(int fromIndex, int toIndex) { - return new SubList(this, fromIndex, toIndex); + return new SubList<>(this, fromIndex, toIndex); } private void rangeCheck(int index) { @@ -776,6 +776,6 @@ } public List subList(int fromIndex, int toIndex) { - return new RandomAccessSubList(this, fromIndex, toIndex); + return new RandomAccessSubList<>(this, fromIndex, toIndex); } } --- old/src/share/classes/java/util/Arrays.java 2010-12-15 14:40:38.191952746 -0800 +++ new/src/share/classes/java/util/Arrays.java 2010-12-15 14:40:37.977396633 -0800 @@ -2824,7 +2824,7 @@ * @return a list view of the specified array */ public static List asList(T... a) { - return new ArrayList(a); + return new ArrayList<>(a); } /** --- old/src/share/classes/java/util/Collections.java 2010-12-15 14:40:39.519950379 -0800 +++ new/src/share/classes/java/util/Collections.java 2010-12-15 14:40:39.315488033 -0800 @@ -1035,7 +1035,7 @@ * @return an unmodifiable view of the specified collection. */ public static Collection unmodifiableCollection(Collection c) { - return new UnmodifiableCollection(c); + return new UnmodifiableCollection<>(c); } /** @@ -1109,7 +1109,7 @@ * @return an unmodifiable view of the specified set. */ public static Set unmodifiableSet(Set s) { - return new UnmodifiableSet(s); + return new UnmodifiableSet<>(s); } /** @@ -1141,7 +1141,7 @@ * @return an unmodifiable view of the specified sorted set. */ public static SortedSet unmodifiableSortedSet(SortedSet s) { - return new UnmodifiableSortedSet(s); + return new UnmodifiableSortedSet<>(s); } /** @@ -1158,13 +1158,13 @@ public Comparator comparator() {return ss.comparator();} public SortedSet subSet(E fromElement, E toElement) { - return new UnmodifiableSortedSet(ss.subSet(fromElement,toElement)); + return new UnmodifiableSortedSet<>(ss.subSet(fromElement,toElement)); } public SortedSet headSet(E toElement) { - return new UnmodifiableSortedSet(ss.headSet(toElement)); + return new UnmodifiableSortedSet<>(ss.headSet(toElement)); } public SortedSet tailSet(E fromElement) { - return new UnmodifiableSortedSet(ss.tailSet(fromElement)); + return new UnmodifiableSortedSet<>(ss.tailSet(fromElement)); } public E first() {return ss.first();} @@ -1188,8 +1188,8 @@ */ public static List unmodifiableList(List list) { return (list instanceof RandomAccess ? - new UnmodifiableRandomAccessList(list) : - new UnmodifiableList(list)); + new UnmodifiableRandomAccessList<>(list) : + new UnmodifiableList<>(list)); } /** @@ -1250,7 +1250,7 @@ } public List subList(int fromIndex, int toIndex) { - return new UnmodifiableList(list.subList(fromIndex, toIndex)); + return new UnmodifiableList<>(list.subList(fromIndex, toIndex)); } /** @@ -1267,7 +1267,7 @@ */ private Object readResolve() { return (list instanceof RandomAccess - ? new UnmodifiableRandomAccessList(list) + ? new UnmodifiableRandomAccessList<>(list) : this); } } @@ -1283,7 +1283,7 @@ } public List subList(int fromIndex, int toIndex) { - return new UnmodifiableRandomAccessList( + return new UnmodifiableRandomAccessList<>( list.subList(fromIndex, toIndex)); } @@ -1296,7 +1296,7 @@ * deserialization. */ private Object writeReplace() { - return new UnmodifiableList(list); + return new UnmodifiableList<>(list); } } @@ -1315,7 +1315,7 @@ * @return an unmodifiable view of the specified map. */ public static Map unmodifiableMap(Map m) { - return new UnmodifiableMap(m); + return new UnmodifiableMap<>(m); } /** @@ -1363,7 +1363,7 @@ public Set> entrySet() { if (entrySet==null) - entrySet = new UnmodifiableEntrySet(m.entrySet()); + entrySet = new UnmodifiableEntrySet<>(m.entrySet()); return entrySet; } @@ -1400,7 +1400,7 @@ return i.hasNext(); } public Map.Entry next() { - return new UnmodifiableEntry(i.next()); + return new UnmodifiableEntry<>(i.next()); } public void remove() { throw new UnsupportedOperationException(); @@ -1411,7 +1411,7 @@ public Object[] toArray() { Object[] a = c.toArray(); for (int i=0; i((Map.Entry)a[i]); + a[i] = new UnmodifiableEntry<>((Map.Entry)a[i]); return a; } @@ -1422,7 +1422,7 @@ Object[] arr = c.toArray(a.length==0 ? a : Arrays.copyOf(a, 0)); for (int i=0; i((Map.Entry)arr[i]); + arr[i] = new UnmodifiableEntry<>((Map.Entry)arr[i]); if (arr.length > a.length) return (T[])arr; @@ -1443,7 +1443,7 @@ if (!(o instanceof Map.Entry)) return false; return c.contains( - new UnmodifiableEntry((Map.Entry) o)); + new UnmodifiableEntry<>((Map.Entry) o)); } /** @@ -1517,7 +1517,7 @@ * @return an unmodifiable view of the specified sorted map. */ public static SortedMap unmodifiableSortedMap(SortedMap m) { - return new UnmodifiableSortedMap(m); + return new UnmodifiableSortedMap<>(m); } /** @@ -1535,13 +1535,13 @@ public Comparator comparator() {return sm.comparator();} public SortedMap subMap(K fromKey, K toKey) { - return new UnmodifiableSortedMap(sm.subMap(fromKey, toKey)); + return new UnmodifiableSortedMap<>(sm.subMap(fromKey, toKey)); } public SortedMap headMap(K toKey) { - return new UnmodifiableSortedMap(sm.headMap(toKey)); + return new UnmodifiableSortedMap<>(sm.headMap(toKey)); } public SortedMap tailMap(K fromKey) { - return new UnmodifiableSortedMap(sm.tailMap(fromKey)); + return new UnmodifiableSortedMap<>(sm.tailMap(fromKey)); } public K firstKey() {return sm.firstKey();} @@ -1583,11 +1583,11 @@ * @return a synchronized view of the specified collection. */ public static Collection synchronizedCollection(Collection c) { - return new SynchronizedCollection(c); + return new SynchronizedCollection<>(c); } static Collection synchronizedCollection(Collection c, Object mutex) { - return new SynchronizedCollection(c, mutex); + return new SynchronizedCollection<>(c, mutex); } /** @@ -1686,11 +1686,11 @@ * @return a synchronized view of the specified set. */ public static Set synchronizedSet(Set s) { - return new SynchronizedSet(s); + return new SynchronizedSet<>(s); } static Set synchronizedSet(Set s, Object mutex) { - return new SynchronizedSet(s, mutex); + return new SynchronizedSet<>(s, mutex); } /** @@ -1754,7 +1754,7 @@ * @return a synchronized view of the specified sorted set. */ public static SortedSet synchronizedSortedSet(SortedSet s) { - return new SynchronizedSortedSet(s); + return new SynchronizedSortedSet<>(s); } /** @@ -1783,18 +1783,18 @@ public SortedSet subSet(E fromElement, E toElement) { synchronized (mutex) { - return new SynchronizedSortedSet( + return new SynchronizedSortedSet<>( ss.subSet(fromElement, toElement), mutex); } } public SortedSet headSet(E toElement) { synchronized (mutex) { - return new SynchronizedSortedSet(ss.headSet(toElement), mutex); + return new SynchronizedSortedSet<>(ss.headSet(toElement), mutex); } } public SortedSet tailSet(E fromElement) { synchronized (mutex) { - return new SynchronizedSortedSet(ss.tailSet(fromElement),mutex); + return new SynchronizedSortedSet<>(ss.tailSet(fromElement),mutex); } } @@ -1833,14 +1833,14 @@ */ public static List synchronizedList(List list) { return (list instanceof RandomAccess ? - new SynchronizedRandomAccessList(list) : - new SynchronizedList(list)); + new SynchronizedRandomAccessList<>(list) : + new SynchronizedList<>(list)); } static List synchronizedList(List list, Object mutex) { return (list instanceof RandomAccess ? - new SynchronizedRandomAccessList(list, mutex) : - new SynchronizedList(list, mutex)); + new SynchronizedRandomAccessList<>(list, mutex) : + new SynchronizedList<>(list, mutex)); } /** @@ -1903,7 +1903,7 @@ public List subList(int fromIndex, int toIndex) { synchronized (mutex) { - return new SynchronizedList(list.subList(fromIndex, toIndex), + return new SynchronizedList<>(list.subList(fromIndex, toIndex), mutex); } } @@ -1922,7 +1922,7 @@ */ private Object readResolve() { return (list instanceof RandomAccess - ? new SynchronizedRandomAccessList(list) + ? new SynchronizedRandomAccessList<>(list) : this); } } @@ -1944,7 +1944,7 @@ public List subList(int fromIndex, int toIndex) { synchronized (mutex) { - return new SynchronizedRandomAccessList( + return new SynchronizedRandomAccessList<>( list.subList(fromIndex, toIndex), mutex); } } @@ -1958,7 +1958,7 @@ * deserialization. */ private Object writeReplace() { - return new SynchronizedList(list); + return new SynchronizedList<>(list); } } @@ -1990,7 +1990,7 @@ * @return a synchronized view of the specified map. */ public static Map synchronizedMap(Map m) { - return new SynchronizedMap(m); + return new SynchronizedMap<>(m); } /** @@ -2051,7 +2051,7 @@ public Set keySet() { synchronized (mutex) { if (keySet==null) - keySet = new SynchronizedSet(m.keySet(), mutex); + keySet = new SynchronizedSet<>(m.keySet(), mutex); return keySet; } } @@ -2059,7 +2059,7 @@ public Set> entrySet() { synchronized (mutex) { if (entrySet==null) - entrySet = new SynchronizedSet>(m.entrySet(), mutex); + entrySet = new SynchronizedSet<>(m.entrySet(), mutex); return entrySet; } } @@ -2067,7 +2067,7 @@ public Collection values() { synchronized (mutex) { if (values==null) - values = new SynchronizedCollection(m.values(), mutex); + values = new SynchronizedCollection<>(m.values(), mutex); return values; } } @@ -2129,7 +2129,7 @@ * @return a synchronized view of the specified sorted map. */ public static SortedMap synchronizedSortedMap(SortedMap m) { - return new SynchronizedSortedMap(m); + return new SynchronizedSortedMap<>(m); } @@ -2159,18 +2159,18 @@ public SortedMap subMap(K fromKey, K toKey) { synchronized (mutex) { - return new SynchronizedSortedMap( + return new SynchronizedSortedMap<>( sm.subMap(fromKey, toKey), mutex); } } public SortedMap headMap(K toKey) { synchronized (mutex) { - return new SynchronizedSortedMap(sm.headMap(toKey), mutex); + return new SynchronizedSortedMap<>(sm.headMap(toKey), mutex); } } public SortedMap tailMap(K fromKey) { synchronized (mutex) { - return new SynchronizedSortedMap(sm.tailMap(fromKey),mutex); + return new SynchronizedSortedMap<>(sm.tailMap(fromKey),mutex); } } @@ -2246,7 +2246,7 @@ */ public static Collection checkedCollection(Collection c, Class type) { - return new CheckedCollection(c, type); + return new CheckedCollection<>(c, type); } @SuppressWarnings("unchecked") @@ -2378,7 +2378,7 @@ * @since 1.5 */ public static Set checkedSet(Set s, Class type) { - return new CheckedSet(s, type); + return new CheckedSet<>(s, type); } /** @@ -2424,7 +2424,7 @@ */ public static SortedSet checkedSortedSet(SortedSet s, Class type) { - return new CheckedSortedSet(s, type); + return new CheckedSortedSet<>(s, type); } /** @@ -2484,8 +2484,8 @@ */ public static List checkedList(List list, Class type) { return (list instanceof RandomAccess ? - new CheckedRandomAccessList(list, type) : - new CheckedList(list, type)); + new CheckedRandomAccessList<>(list, type) : + new CheckedList<>(list, type)); } /** @@ -2550,7 +2550,7 @@ } public List subList(int fromIndex, int toIndex) { - return new CheckedList(list.subList(fromIndex, toIndex), type); + return new CheckedList<>(list.subList(fromIndex, toIndex), type); } } @@ -2567,7 +2567,7 @@ } public List subList(int fromIndex, int toIndex) { - return new CheckedRandomAccessList( + return new CheckedRandomAccessList<>( list.subList(fromIndex, toIndex), type); } } @@ -2609,7 +2609,7 @@ public static Map checkedMap(Map m, Class keyType, Class valueType) { - return new CheckedMap(m, keyType, valueType); + return new CheckedMap<>(m, keyType, valueType); } @@ -2678,14 +2678,14 @@ // - correct behavior if t is a concurrent map Object[] entries = t.entrySet().toArray(); List> checked = - new ArrayList>(entries.length); + new ArrayList<>(entries.length); for (Object o : entries) { Map.Entry e = (Map.Entry) o; Object k = e.getKey(); Object v = e.getValue(); typeCheck(k, v); checked.add( - new AbstractMap.SimpleImmutableEntry((K) k, (V) v)); + new AbstractMap.SimpleImmutableEntry<>((K) k, (V) v)); } for (Map.Entry e : checked) m.put(e.getKey(), e.getValue()); @@ -2695,7 +2695,7 @@ public Set> entrySet() { if (entrySet==null) - entrySet = new CheckedEntrySet(m.entrySet(), valueType); + entrySet = new CheckedEntrySet<>(m.entrySet(), valueType); return entrySet; } @@ -2810,7 +2810,7 @@ if (!(o instanceof Map.Entry)) return false; return s.remove(new AbstractMap.SimpleImmutableEntry - ((Map.Entry)o)); + <>((Map.Entry)o)); } public boolean removeAll(Collection c) { @@ -2843,7 +2843,7 @@ static CheckedEntry checkedEntry(Map.Entry e, Class valueType) { - return new CheckedEntry(e, valueType); + return new CheckedEntry<>(e, valueType); } /** @@ -2884,7 +2884,7 @@ if (!(o instanceof Map.Entry)) return false; return e.equals(new AbstractMap.SimpleImmutableEntry - ((Map.Entry)o)); + <>((Map.Entry)o)); } } } @@ -2927,7 +2927,7 @@ public static SortedMap checkedSortedMap(SortedMap m, Class keyType, Class valueType) { - return new CheckedSortedMap(m, keyType, valueType); + return new CheckedSortedMap<>(m, keyType, valueType); } /** @@ -2993,7 +2993,7 @@ private static class EmptyIterator implements Iterator { static final EmptyIterator EMPTY_ITERATOR - = new EmptyIterator(); + = new EmptyIterator<>(); public boolean hasNext() { return false; } public E next() { throw new NoSuchElementException(); } @@ -3042,7 +3042,7 @@ implements ListIterator { static final EmptyListIterator EMPTY_ITERATOR - = new EmptyListIterator(); + = new EmptyListIterator<>(); public boolean hasPrevious() { return false; } public E previous() { throw new NoSuchElementException(); } @@ -3078,7 +3078,7 @@ private static class EmptyEnumeration implements Enumeration { static final EmptyEnumeration EMPTY_ENUMERATION - = new EmptyEnumeration(); + = new EmptyEnumeration<>(); public boolean hasMoreElements() { return false; } public E nextElement() { throw new NoSuchElementException(); } @@ -3090,7 +3090,7 @@ * @see #emptySet() */ @SuppressWarnings("unchecked") - public static final Set EMPTY_SET = new EmptySet(); + public static final Set EMPTY_SET = new EmptySet<>(); /** * Returns the empty set (immutable). This set is serializable. @@ -3150,7 +3150,7 @@ * @see #emptyList() */ @SuppressWarnings("unchecked") - public static final List EMPTY_LIST = new EmptyList(); + public static final List EMPTY_LIST = new EmptyList<>(); /** * Returns the empty list (immutable). This list is serializable. @@ -3224,7 +3224,7 @@ * @since 1.3 */ @SuppressWarnings("unchecked") - public static final Map EMPTY_MAP = new EmptyMap(); + public static final Map EMPTY_MAP = new EmptyMap<>(); /** * Returns the empty map (immutable). This map is serializable. @@ -3286,7 +3286,7 @@ * @return an immutable set containing only the specified object. */ public static Set singleton(T o) { - return new SingletonSet(o); + return new SingletonSet<>(o); } static Iterator singletonIterator(final E e) { @@ -3339,7 +3339,7 @@ * @since 1.3 */ public static List singletonList(T o) { - return new SingletonList(o); + return new SingletonList<>(o); } /** @@ -3381,7 +3381,7 @@ * @since 1.3 */ public static Map singletonMap(K key, V value) { - return new SingletonMap(key, value); + return new SingletonMap<>(key, value); } /** @@ -3423,7 +3423,7 @@ public Set> entrySet() { if (entrySet==null) entrySet = Collections.>singleton( - new SimpleImmutableEntry(k, v)); + new SimpleImmutableEntry<>(k, v)); return entrySet; } @@ -3455,7 +3455,7 @@ public static List nCopies(int n, T o) { if (n < 0) throw new IllegalArgumentException("List length = " + n); - return new CopiesList(n, o); + return new CopiesList<>(n, o); } /** @@ -3529,7 +3529,7 @@ if (fromIndex > toIndex) throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")"); - return new CopiesList(toIndex - fromIndex, element); + return new CopiesList<>(toIndex - fromIndex, element); } } @@ -3595,7 +3595,7 @@ if (cmp instanceof ReverseComparator2) return ((ReverseComparator2)cmp).cmp; - return new ReverseComparator2(cmp); + return new ReverseComparator2<>(cmp); } /** @@ -3674,7 +3674,7 @@ * @see ArrayList */ public static ArrayList list(Enumeration e) { - ArrayList l = new ArrayList(); + ArrayList l = new ArrayList<>(); while (e.hasMoreElements()) l.add(e.nextElement()); return l; @@ -3819,7 +3819,7 @@ * @since 1.6 */ public static Set newSetFromMap(Map map) { - return new SetFromMap(map); + return new SetFromMap<>(map); } /** @@ -3883,7 +3883,7 @@ * @since 1.6 */ public static Queue asLifoQueue(Deque deque) { - return new AsLIFOQueue(deque); + return new AsLIFOQueue<>(deque); } /** --- old/src/share/classes/java/util/EnumMap.java 2010-12-15 14:40:40.707483786 -0800 +++ new/src/share/classes/java/util/EnumMap.java 2010-12-15 14:40:40.483307735 -0800 @@ -499,7 +499,7 @@ int j = 0; for (int i = 0; i < vals.length; i++) if (vals[i] != null) - a[j++] = new AbstractMap.SimpleEntry( + a[j++] = new AbstractMap.SimpleEntry<>( keyUniverse[i], unmaskNull(vals[i])); return a; } --- old/src/share/classes/java/util/EnumSet.java 2010-12-15 14:40:41.647945198 -0800 +++ new/src/share/classes/java/util/EnumSet.java 2010-12-15 14:40:41.419611083 -0800 @@ -110,9 +110,9 @@ throw new ClassCastException(elementType + " not an enum"); if (universe.length <= 64) - return new RegularEnumSet(elementType, universe); + return new RegularEnumSet<>(elementType, universe); else - return new JumboEnumSet(elementType, universe); + return new JumboEnumSet<>(elementType, universe); } /** @@ -430,7 +430,7 @@ } Object writeReplace() { - return new SerializationProxy(this); + return new SerializationProxy<>(this); } // readObject method for the serialization proxy pattern --- old/src/share/classes/java/util/Formatter.java 2010-12-15 14:40:42.583296735 -0800 +++ new/src/share/classes/java/util/Formatter.java 2010-12-15 14:40:42.363312855 -0800 @@ -2490,7 +2490,7 @@ * Finds format specifiers in the format string. */ private FormatString[] parse(String s) { - ArrayList al = new ArrayList(); + ArrayList al = new ArrayList<>(); Matcher m = fsPattern.matcher(s); for (int i = 0, len = s.length(); i < len; ) { if (m.find(i)) { --- old/src/share/classes/java/util/HashMap.java 2010-12-15 14:40:43.672185995 -0800 +++ new/src/share/classes/java/util/HashMap.java 2010-12-15 14:40:43.416053089 -0800 @@ -763,7 +763,7 @@ */ void addEntry(int hash, K key, V value, int bucketIndex) { Entry e = table[bucketIndex]; - table[bucketIndex] = new Entry(hash, key, value, e); + table[bucketIndex] = new Entry<>(hash, key, value, e); if (size++ >= threshold) resize(2 * table.length); } @@ -778,7 +778,7 @@ */ void createEntry(int hash, K key, V value, int bucketIndex) { Entry e = table[bucketIndex]; - table[bucketIndex] = new Entry(hash, key, value, e); + table[bucketIndex] = new Entry<>(hash, key, value, e); size++; } --- old/src/share/classes/java/util/HashSet.java 2010-12-15 14:40:44.695293968 -0800 +++ new/src/share/classes/java/util/HashSet.java 2010-12-15 14:40:44.463286752 -0800 @@ -100,7 +100,7 @@ * default initial capacity (16) and load factor (0.75). */ public HashSet() { - map = new HashMap(); + map = new HashMap<>(); } /** @@ -113,7 +113,7 @@ * @throws NullPointerException if the specified collection is null */ public HashSet(Collection c) { - map = new HashMap(Math.max((int) (c.size()/.75f) + 1, 16)); + map = new HashMap<>(Math.max((int) (c.size()/.75f) + 1, 16)); addAll(c); } @@ -127,7 +127,7 @@ * than zero, or if the load factor is nonpositive */ public HashSet(int initialCapacity, float loadFactor) { - map = new HashMap(initialCapacity, loadFactor); + map = new HashMap<>(initialCapacity, loadFactor); } /** @@ -139,7 +139,7 @@ * than zero */ public HashSet(int initialCapacity) { - map = new HashMap(initialCapacity); + map = new HashMap<>(initialCapacity); } /** @@ -156,7 +156,7 @@ * than zero, or if the load factor is nonpositive */ HashSet(int initialCapacity, float loadFactor, boolean dummy) { - map = new LinkedHashMap(initialCapacity, loadFactor); + map = new LinkedHashMap<>(initialCapacity, loadFactor); } /** --- old/src/share/classes/java/util/Hashtable.java 2010-12-15 14:40:45.699315988 -0800 +++ new/src/share/classes/java/util/Hashtable.java 2010-12-15 14:40:45.475298058 -0800 @@ -455,7 +455,7 @@ // Creates the new entry. Entry e = tab[index]; - tab[index] = new Entry(hash, key, value, e); + tab[index] = new Entry<>(hash, key, value, e); count++; return null; } @@ -579,7 +579,7 @@ if (count == 0) { return Collections.emptyEnumeration(); } else { - return new Enumerator(type, false); + return new Enumerator<>(type, false); } } @@ -587,7 +587,7 @@ if (count == 0) { return Collections.emptyIterator(); } else { - return new Enumerator(type, true); + return new Enumerator<>(type, true); } } @@ -929,7 +929,7 @@ } // Creates the new entry. Entry e = tab[index]; - tab[index] = new Entry(hash, key, value, e); + tab[index] = new Entry<>(hash, key, value, e); count++; } @@ -950,7 +950,7 @@ } protected Object clone() { - return new Entry(hash, key, value, + return new Entry<>(hash, key, value, (next==null ? null : (Entry) next.clone())); } --- old/src/share/classes/java/util/IdentityHashMap.java 2010-12-15 14:40:46.679365960 -0800 +++ new/src/share/classes/java/util/IdentityHashMap.java 2010-12-15 14:40:46.455792783 -0800 @@ -1134,7 +1134,7 @@ Object[] result = new Object[size]; Iterator> it = iterator(); for (int i = 0; i < size; i++) - result[i] = new AbstractMap.SimpleEntry(it.next()); + result[i] = new AbstractMap.SimpleEntry<>(it.next()); return result; } @@ -1146,7 +1146,7 @@ .newInstance(a.getClass().getComponentType(), size); Iterator> it = iterator(); for (int i = 0; i < size; i++) - a[i] = (T) new AbstractMap.SimpleEntry(it.next()); + a[i] = (T) new AbstractMap.SimpleEntry<>(it.next()); if (a.length > size) a[size] = null; return a; --- old/src/share/classes/java/util/JumboEnumSet.java 2010-12-15 14:40:47.635731070 -0800 +++ new/src/share/classes/java/util/JumboEnumSet.java 2010-12-15 14:40:47.411477925 -0800 @@ -89,7 +89,7 @@ * @return an iterator over the elements contained in this set */ public Iterator iterator() { - return new EnumSetIterator(); + return new EnumSetIterator<>(); } private class EnumSetIterator> implements Iterator { --- old/src/share/classes/java/util/LinkedHashMap.java 2010-12-15 14:40:48.563786425 -0800 +++ new/src/share/classes/java/util/LinkedHashMap.java 2010-12-15 14:40:48.339537201 -0800 @@ -237,7 +237,7 @@ * the chain. */ void init() { - header = new Entry(-1, null, null, null); + header = new Entry<>(-1, null, null, null); header.before = header.after = header; } @@ -438,7 +438,7 @@ */ void createEntry(int hash, K key, V value, int bucketIndex) { HashMap.Entry old = table[bucketIndex]; - Entry e = new Entry(hash, key, value, old); + Entry e = new Entry<>(hash, key, value, old); table[bucketIndex] = e; e.addBefore(header); size++; --- old/src/share/classes/java/util/LinkedList.java 2010-12-15 14:40:49.567877170 -0800 +++ new/src/share/classes/java/util/LinkedList.java 2010-12-15 14:40:49.319291047 -0800 @@ -122,7 +122,7 @@ */ private void linkFirst(E e) { final Node f = first; - final Node newNode = new Node(null, e, f); + final Node newNode = new Node<>(null, e, f); first = newNode; if (f == null) last = newNode; @@ -137,7 +137,7 @@ */ void linkLast(E e) { final Node l = last; - final Node newNode = new Node(l, e, null); + final Node newNode = new Node<>(l, e, null); last = newNode; if (l == null) first = newNode; @@ -153,7 +153,7 @@ void linkBefore(E e, Node succ) { // assert succ != null; final Node pred = succ.prev; - final Node newNode = new Node(pred, e, succ); + final Node newNode = new Node<>(pred, e, succ); succ.prev = newNode; if (pred == null) first = newNode; @@ -419,7 +419,7 @@ for (Object o : a) { @SuppressWarnings("unchecked") E e = (E) o; - Node newNode = new Node(pred, e, null); + Node newNode = new Node<>(pred, e, null); if (pred == null) first = newNode; else --- old/src/share/classes/java/util/ListResourceBundle.java 2010-12-15 14:40:50.539522438 -0800 +++ new/src/share/classes/java/util/ListResourceBundle.java 2010-12-15 14:40:50.311438371 -0800 @@ -187,7 +187,7 @@ return; Object[][] contents = getContents(); - HashMap temp = new HashMap(contents.length); + HashMap temp = new HashMap<>(contents.length); for (int i = 0; i < contents.length; ++i) { // key must be non-null String, value must be non-null String key = (String) contents[i][0]; --- old/src/share/classes/java/util/PriorityQueue.java 2010-12-15 14:40:51.507463046 -0800 +++ new/src/share/classes/java/util/PriorityQueue.java 2010-12-15 14:40:51.279311095 -0800 @@ -538,7 +538,7 @@ cursor--; else { if (forgetMeNot == null) - forgetMeNot = new ArrayDeque(); + forgetMeNot = new ArrayDeque<>(); forgetMeNot.add(moved); } } else if (lastRetElt != null) { --- old/src/share/classes/java/util/Properties.java 2010-12-15 14:40:52.492108299 -0800 +++ new/src/share/classes/java/util/Properties.java 2010-12-15 14:40:52.243425239 -0800 @@ -1011,7 +1011,7 @@ * @since 1.6 */ public Set stringPropertyNames() { - Hashtable h = new Hashtable(); + Hashtable h = new Hashtable<>(); enumerateStringProperties(h); return h.keySet(); } --- old/src/share/classes/java/util/RegularEnumSet.java 2010-12-15 14:40:53.459762563 -0800 +++ new/src/share/classes/java/util/RegularEnumSet.java 2010-12-15 14:40:53.235291522 -0800 @@ -71,7 +71,7 @@ * @return an iterator over the elements contained in this set */ public Iterator iterator() { - return new EnumSetIterator(); + return new EnumSetIterator<>(); } private class EnumSetIterator> implements Iterator { --- old/src/share/classes/java/util/ServiceLoader.java 2010-12-15 14:40:54.459762284 -0800 +++ new/src/share/classes/java/util/ServiceLoader.java 2010-12-15 14:40:54.227288268 -0800 @@ -191,7 +191,7 @@ private ClassLoader loader; // Cached providers, in instantiation order - private LinkedHashMap providers = new LinkedHashMap(); + private LinkedHashMap providers = new LinkedHashMap<>(); // The current lazy-lookup iterator private LazyIterator lookupIterator; @@ -291,7 +291,7 @@ { InputStream in = null; BufferedReader r = null; - ArrayList names = new ArrayList(); + ArrayList names = new ArrayList<>(); try { in = u.openStream(); r = new BufferedReader(new InputStreamReader(in, "utf-8")); @@ -463,7 +463,7 @@ public static ServiceLoader load(Class service, ClassLoader loader) { - return new ServiceLoader(service, loader); + return new ServiceLoader<>(service, loader); } /** --- old/src/share/classes/java/util/TimSort.java 2010-12-15 14:40:55.435352474 -0800 +++ new/src/share/classes/java/util/TimSort.java 2010-12-15 14:40:55.199469641 -0800 @@ -196,7 +196,7 @@ * extending short natural runs to minRun elements, and merging runs * to maintain stack invariant. */ - TimSort ts = new TimSort(a, c); + TimSort ts = new TimSort<>(a, c); int minRun = minRunLength(nRemaining); do { // Identify next run --- old/src/share/classes/java/util/TreeMap.java 2010-12-15 14:40:56.399788169 -0800 +++ new/src/share/classes/java/util/TreeMap.java 2010-12-15 14:40:56.183315348 -0800 @@ -533,7 +533,7 @@ // throw NullPointerException // // compare(key, key); // type check - root = new Entry(key, value, null); + root = new Entry<>(key, value, null); size = 1; modCount++; return null; @@ -569,7 +569,7 @@ return t.setValue(value); } while (t != null); } - Entry e = new Entry(key, value, parent); + Entry e = new Entry<>(key, value, parent); if (cmp < 0) parent.left = e; else @@ -1069,14 +1069,14 @@ } public NavigableSet subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) { - return new KeySet(m.subMap(fromElement, fromInclusive, + return new KeySet<>(m.subMap(fromElement, fromInclusive, toElement, toInclusive)); } public NavigableSet headSet(E toElement, boolean inclusive) { - return new KeySet(m.headMap(toElement, inclusive)); + return new KeySet<>(m.headMap(toElement, inclusive)); } public NavigableSet tailSet(E fromElement, boolean inclusive) { - return new KeySet(m.tailMap(fromElement, inclusive)); + return new KeySet<>(m.tailMap(fromElement, inclusive)); } public SortedSet subSet(E fromElement, E toElement) { return subSet(fromElement, true, toElement, false); @@ -1205,7 +1205,7 @@ */ static Map.Entry exportEntry(TreeMap.Entry e) { return (e == null) ? null : - new AbstractMap.SimpleImmutableEntry(e); + new AbstractMap.SimpleImmutableEntry<>(e); } /** @@ -2406,7 +2406,7 @@ value = (defaultVal != null ? defaultVal : (V) str.readObject()); } - Entry middle = new Entry(key, value, null); + Entry middle = new Entry<>(key, value, null); // color nodes in non-full bottommost level red if (level == redLevel) --- old/src/share/classes/java/util/TreeSet.java 2010-12-15 14:40:57.383593650 -0800 +++ new/src/share/classes/java/util/TreeSet.java 2010-12-15 14:40:57.163602501 -0800 @@ -138,7 +138,7 @@ * ordering} of the elements will be used. */ public TreeSet(Comparator comparator) { - this(new TreeMap(comparator)); + this(new TreeMap<>(comparator)); } /** @@ -195,7 +195,7 @@ * @since 1.6 */ public NavigableSet descendingSet() { - return new TreeSet(m.descendingMap()); + return new TreeSet<>(m.descendingMap()); } /** @@ -322,7 +322,7 @@ */ public NavigableSet subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) { - return new TreeSet(m.subMap(fromElement, fromInclusive, + return new TreeSet<>(m.subMap(fromElement, fromInclusive, toElement, toInclusive)); } @@ -335,7 +335,7 @@ * @since 1.6 */ public NavigableSet headSet(E toElement, boolean inclusive) { - return new TreeSet(m.headMap(toElement, inclusive)); + return new TreeSet<>(m.headMap(toElement, inclusive)); } /** @@ -347,7 +347,7 @@ * @since 1.6 */ public NavigableSet tailSet(E fromElement, boolean inclusive) { - return new TreeSet(m.tailMap(fromElement, inclusive)); + return new TreeSet<>(m.tailMap(fromElement, inclusive)); } /** @@ -477,7 +477,7 @@ throw new InternalError(); } - clone.m = new TreeMap(m); + clone.m = new TreeMap<>(m); return clone; } @@ -524,9 +524,9 @@ // Create backing TreeMap TreeMap tm; if (c==null) - tm = new TreeMap(); + tm = new TreeMap<>(); else - tm = new TreeMap(c); + tm = new TreeMap<>(c); m = tm; // Read in size --- old/src/share/classes/java/util/WeakHashMap.java 2010-12-15 14:40:58.307915298 -0800 +++ new/src/share/classes/java/util/WeakHashMap.java 2010-12-15 14:40:58.087459836 -0800 @@ -171,7 +171,7 @@ /** * Reference queue for cleared WeakEntries */ - private final ReferenceQueue queue = new ReferenceQueue(); + private final ReferenceQueue queue = new ReferenceQueue<>(); /** * The number of times this WeakHashMap has been structurally modified. @@ -439,7 +439,7 @@ modCount++; Entry e = tab[i]; - tab[i] = new Entry(k, value, queue, h, e); + tab[i] = new Entry<>(k, value, queue, h, e); if (++size >= threshold) resize(tab.length * 2); return null; @@ -956,9 +956,9 @@ private List> deepCopy() { List> list = - new ArrayList>(size()); + new ArrayList<>(size()); for (Map.Entry e : this) - list.add(new AbstractMap.SimpleEntry(e)); + list.add(new AbstractMap.SimpleEntry<>(e)); return list; } --- old/src/share/classes/java/util/logging/FileHandler.java 2010-12-15 14:40:59.275881610 -0800 +++ new/src/share/classes/java/util/logging/FileHandler.java 2010-12-15 14:40:59.039289450 -0800 @@ -127,7 +127,7 @@ private FileOutputStream lockStream; private File files[]; private static final int MAX_LOCKS = 100; - private static java.util.HashMap locks = new java.util.HashMap(); + private static java.util.HashMap locks = new java.util.HashMap<>(); // A metered stream is a subclass of OutputStream that // (a) forwards all its output to a target stream --- old/src/share/classes/java/util/logging/Level.java 2010-12-15 14:41:00.215384796 -0800 +++ new/src/share/classes/java/util/logging/Level.java 2010-12-15 14:40:59.987454635 -0800 @@ -59,7 +59,7 @@ */ public class Level implements java.io.Serializable { - private static java.util.ArrayList known = new java.util.ArrayList(); + private static java.util.ArrayList known = new java.util.ArrayList<>(); private static String defaultBundle = "sun.util.logging.resources.logging"; /** --- old/src/share/classes/java/util/logging/LogManager.java 2010-12-15 14:41:01.155727474 -0800 +++ new/src/share/classes/java/util/logging/LogManager.java 2010-12-15 14:41:00.919291490 -0800 @@ -157,7 +157,7 @@ // Table of named Loggers that maps names to Loggers. private Hashtable namedLoggers = - new Hashtable(); + new Hashtable<>(); // Tree of named Loggers private LogNode root = new LogNode(null); private Logger rootLogger; @@ -422,7 +422,7 @@ // loggerRefQueue holds LoggerWeakRef objects for Logger objects // that have been GC'ed. private final ReferenceQueue loggerRefQueue - = new ReferenceQueue(); + = new ReferenceQueue<>(); // Package-level inner class. // Helper class for managing WeakReferences to Logger objects. @@ -672,7 +672,7 @@ name = ""; } if (node.children == null) { - node.children = new HashMap(); + node.children = new HashMap<>(); } LogNode child = node.children.get(head); if (child == null) { @@ -856,7 +856,7 @@ } hands = hands.trim(); int ix = 0; - Vector result = new Vector(); + Vector result = new Vector<>(); while (ix < hands.length()) { int end = ix; while (end < hands.length()) { --- old/src/share/classes/java/util/logging/LogRecord.java 2010-12-15 14:41:02.124202786 -0800 +++ new/src/share/classes/java/util/logging/LogRecord.java 2010-12-15 14:41:01.895298771 -0800 @@ -86,7 +86,7 @@ = new AtomicInteger(MIN_SEQUENTIAL_THREAD_ID); private static final ThreadLocal threadIds - = new ThreadLocal(); + = new ThreadLocal<>(); /** * @serial Logging message level --- old/src/share/classes/java/util/logging/Logger.java 2010-12-15 14:41:03.051429544 -0800 +++ new/src/share/classes/java/util/logging/Logger.java 2010-12-15 14:41:02.823425932 -0800 @@ -170,7 +170,7 @@ private LogManager manager; private String name; private final CopyOnWriteArrayList handlers = - new CopyOnWriteArrayList(); + new CopyOnWriteArrayList<>(); private String resourceBundleName; private volatile boolean useParentHandlers = true; private volatile Filter filter; @@ -1420,13 +1420,13 @@ // Set our new parent. parent = newParent; if (parent.kids == null) { - parent.kids = new ArrayList(2); + parent.kids = new ArrayList<>(2); } if (ref == null) { // we didn't have a previous parent ref = manager.new LoggerWeakRef(this); } - ref.setParentRef(new WeakReference(parent)); + ref.setParentRef(new WeakReference<>(parent)); parent.kids.add(ref); // As a result of the reparenting, the effective level --- old/src/share/classes/java/util/logging/Logging.java 2010-12-15 14:41:04.019372663 -0800 +++ new/src/share/classes/java/util/logging/Logging.java 2010-12-15 14:41:03.799289618 -0800 @@ -56,7 +56,7 @@ public List getLoggerNames() { Enumeration loggers = logManager.getLoggerNames(); - ArrayList array = new ArrayList(); + ArrayList array = new ArrayList<>(); for (; loggers.hasMoreElements();) { array.add((String) loggers.nextElement()); --- old/src/share/classes/java/util/prefs/AbstractPreferences.java 2010-12-15 14:41:05.059725016 -0800 +++ new/src/share/classes/java/util/prefs/AbstractPreferences.java 2010-12-15 14:41:04.831292855 -0800 @@ -156,7 +156,7 @@ * prior to calling childSpi() or getChild(). */ private Map kidCache - = new HashMap(); + = new HashMap<>(); /** * This field is used to keep track of whether or not this node has @@ -713,7 +713,7 @@ if (removed) throw new IllegalStateException("Node has been removed."); - Set s = new TreeSet(kidCache.keySet()); + Set s = new TreeSet<>(kidCache.keySet()); for (String kid : childrenNamesSpi()) s.add(kid); return s.toArray(EMPTY_STRING_ARRAY); @@ -1443,7 +1443,7 @@ * locking and reducing opportunity for deadlock. */ private static final List eventQueue - = new LinkedList(); + = new LinkedList<>(); /** * These two classes are used to distinguish NodeChangeEvents on --- old/src/share/classes/java/util/regex/Pattern.java 2010-12-15 14:41:06.203715708 -0800 +++ new/src/share/classes/java/util/regex/Pattern.java 2010-12-15 14:41:05.979446629 -0800 @@ -1068,7 +1068,7 @@ public String[] split(CharSequence input, int limit) { int index = 0; boolean matchLimited = limit > 0; - ArrayList matchList = new ArrayList(); + ArrayList matchList = new ArrayList<>(); Matcher m = matcher(input); // Add segments before each match found @@ -1566,7 +1566,7 @@ Map namedGroups() { if (namedGroups == null) - namedGroups = new HashMap(2); + namedGroups = new HashMap<>(2); return namedGroups; } @@ -5309,7 +5309,7 @@ } private static final HashMap map - = new HashMap(); + = new HashMap<>(); static { // Unicode character property aliases, defined in --- old/src/share/classes/java/util/zip/ZipFile.java 2010-12-15 14:41:07.267845111 -0800 +++ new/src/share/classes/java/util/zip/ZipFile.java 2010-12-15 14:41:07.047418139 -0800 @@ -543,7 +543,7 @@ if (streams.size() !=0) { Set copy = streams; - streams = new HashSet(); + streams = new HashSet<>(); for (InputStream is: copy) is.close(); } --- old/src/share/classes/java/util/zip/ZipOutputStream.java 2010-12-15 14:41:08.232174924 -0800 +++ new/src/share/classes/java/util/zip/ZipOutputStream.java 2010-12-15 14:41:07.999286588 -0800 @@ -52,8 +52,8 @@ } private XEntry current; - private Vector xentries = new Vector(); - private HashSet names = new HashSet(); + private Vector xentries = new Vector<>(); + private HashSet names = new HashSet<>(); private CRC32 crc = new CRC32(); private long written = 0; private long locoff = 0; --- old/src/share/classes/sun/io/Converters.java 2010-12-15 14:41:09.221260124 -0800 +++ new/src/share/classes/sun/io/Converters.java 2010-12-15 14:41:08.947290026 -0800 @@ -120,7 +120,7 @@ private static Class cache(int type, Object encoding, Class c) { SoftReference[] srs = classCache[type]; - srs[CACHE_SIZE - 1] = new SoftReference(new Object[] { c, encoding }); + srs[CACHE_SIZE - 1] = new SoftReference<>(new Object[] { c, encoding }); moveToFront(srs, CACHE_SIZE - 1); return c; } --- old/src/share/classes/sun/util/logging/PlatformLogger.java 2010-12-15 14:41:10.155988681 -0800 +++ new/src/share/classes/sun/util/logging/PlatformLogger.java 2010-12-15 14:41:09.931573779 -0800 @@ -113,7 +113,7 @@ // Table of known loggers. Maps names to PlatformLoggers. private static Map> loggers = - new HashMap>(); + new HashMap<>(); /** * Returns a PlatformLogger of a given name. @@ -126,7 +126,7 @@ } if (log == null) { log = new PlatformLogger(name); - loggers.put(name, new WeakReference(log)); + loggers.put(name, new WeakReference<>(log)); } return log; } @@ -488,7 +488,7 @@ */ static class JavaLogger extends LoggerProxy { private static final Map levelObjects = - new HashMap(); + new HashMap<>(); static { if (LoggingSupport.isAvailable()) { --- old/src/solaris/classes/java/lang/ProcessEnvironment.java 2010-12-15 14:41:11.091681882 -0800 +++ new/src/solaris/classes/java/lang/ProcessEnvironment.java 2010-12-15 14:41:10.867296043 -0800 @@ -68,7 +68,7 @@ // We cache the C environment. This means that subsequent calls // to putenv/setenv from C will not be visible from Java code. byte[][] environ = environ(); - theEnvironment = new HashMap(environ.length/2 + 3); + theEnvironment = new HashMap<>(environ.length/2 + 3); // Read environment variables back to front, // so that earlier variables override later ones. for (int i = environ.length-1; i > 0; i-=2) --- old/src/solaris/classes/java/util/prefs/FileSystemPreferences.java 2010-12-15 14:41:12.023634381 -0800 +++ new/src/solaris/classes/java/util/prefs/FileSystemPreferences.java 2010-12-15 14:41:11.803944121 -0800 @@ -354,7 +354,7 @@ * log against that map. The resulting map is then written back * to the disk. */ - final List changeLog = new ArrayList(); + final List changeLog = new ArrayList<>(); /** * Represents a change to a preference. @@ -507,7 +507,7 @@ }); if (newNode) { // These 2 things guarantee node will get wrtten at next flush/sync - prefsCache = new TreeMap(); + prefsCache = new TreeMap<>(); nodeCreate = new NodeCreate(); changeLog.add(nodeCreate); } @@ -550,7 +550,7 @@ loadCache(); } catch(Exception e) { // assert lastSyncTime == 0; - prefsCache = new TreeMap(); + prefsCache = new TreeMap<>(); } } @@ -567,7 +567,7 @@ AccessController.doPrivileged( new PrivilegedExceptionAction() { public Void run() throws BackingStoreException { - Map m = new TreeMap(); + Map m = new TreeMap<>(); long newLastSyncTime = 0; try { newLastSyncTime = prefsFile.lastModified(); @@ -581,7 +581,7 @@ prefsFile.renameTo( new File( prefsFile.getParentFile(), "IncorrectFormatPrefs.xml")); - m = new TreeMap(); + m = new TreeMap<>(); } else if (e instanceof FileNotFoundException) { getLogger().warning("Prefs file removed in background " + prefsFile.getPath()); @@ -646,7 +646,7 @@ return AccessController.doPrivileged( new PrivilegedAction() { public String[] run() { - List result = new ArrayList(); + List result = new ArrayList<>(); File[] dirContents = dir.listFiles(); if (dirContents != null) { for (int i = 0; i < dirContents.length; i++) @@ -794,7 +794,7 @@ } else if (lastSyncTime != 0 && !dir.exists()) { // This node was removed in the background. Playback any changes // against a virgin (empty) Map. - prefsCache = new TreeMap(); + prefsCache = new TreeMap<>(); replayChanges(); } if (!changeLog.isEmpty()) { --- old/src/windows/classes/java/lang/ProcessEnvironment.java 2010-12-15 14:41:12.967828953 -0800 +++ new/src/windows/classes/java/lang/ProcessEnvironment.java 2010-12-15 14:41:12.743483906 -0800 @@ -251,7 +251,7 @@ } theCaseInsensitiveEnvironment - = new TreeMap(nameComparator); + = new TreeMap<>(nameComparator); theCaseInsensitiveEnvironment.putAll(theEnvironment); } @@ -297,7 +297,7 @@ String toEnvironmentBlock() { // Sort Unicode-case-insensitively by name List> list - = new ArrayList>(entrySet()); + = new ArrayList<>(entrySet()); Collections.sort(list, entryComparator); StringBuilder sb = new StringBuilder(size()*30); --- old/test/java/io/Serializable/NPEProvoker/NPEProvoker.java 2010-12-15 14:41:13.947398140 -0800 +++ new/test/java/io/Serializable/NPEProvoker/NPEProvoker.java 2010-12-15 14:41:13.719485318 -0800 @@ -56,7 +56,7 @@ public static void main(String[] args) { System.err.println("\n Regression test for bug 6541870\n"); try { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new NPEProvoker()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); --- old/test/java/lang/instrument/ilib/Inject.java 2010-12-15 14:41:14.920070080 -0800 +++ new/test/java/lang/instrument/ilib/Inject.java 2010-12-15 14:41:14.695323860 -0800 @@ -107,7 +107,7 @@ class IndexedInjector implements TrackerInjector { int counter = 0; int tracker; - List infoList = new ArrayList(); + List infoList = new ArrayList<>(); public int stackSize(int currentSize) { return currentSize + 1; --- old/test/java/lang/instrument/ilib/InjectBytecodes.java 2010-12-15 14:41:15.876250257 -0800 +++ new/test/java/lang/instrument/ilib/InjectBytecodes.java 2010-12-15 14:41:15.643290137 -0800 @@ -50,7 +50,7 @@ private final Injector[] after = new Injector[256]; private final String className; private final String methodName; - private final Map snippets = new HashMap(); + private final Map snippets = new HashMap<>(); private int pos; private int newPos; --- old/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java 2010-12-15 14:41:16.836262483 -0800 +++ new/test/java/lang/reflect/Generics/TestPlainArrayNotGeneric.java 2010-12-15 14:41:16.611290526 -0800 @@ -103,7 +103,7 @@ } } - private static final Set checking = new HashSet(); + private static final Set checking = new HashSet<>(); private static void check(Type t, String what) { if (t == null || !checking.add(t)) --- old/test/java/util/Random/DistinctSeeds.java 2010-12-15 14:41:17.768168335 -0800 +++ new/test/java/util/Random/DistinctSeeds.java 2010-12-15 14:41:17.531353241 -0800 @@ -59,7 +59,7 @@ } } final int threadCount = 2; - List collectors = new ArrayList(); + List collectors = new ArrayList<>(); List threads = new ArrayList(); for (int i = 0; i < threadCount; i++) { RandomCollector r = new RandomCollector(); --- old/test/java/util/logging/ClassLoaderLeakTest.java 2010-12-15 14:41:18.692028468 -0800 +++ new/test/java/util/logging/ClassLoaderLeakTest.java 2010-12-15 14:41:18.459410284 -0800 @@ -89,7 +89,7 @@ MyClassLoader appClassLoader = new MyClassLoader(urls, "test0"); WeakReference ref = - new WeakReference(appClassLoader); + new WeakReference<>(appClassLoader); Thread appThread = new Thread(appsThreadGroup, launcher, "AppThread-0");