diff -r 74f2ee2b62ba -r 56bc97d69d93 jdk/src/share/classes/java/lang/ClassLoader.java --- a/jdk/src/share/classes/java/lang/ClassLoader.java Sat Dec 18 09:10:49 2010 -0800 +++ b/jdk/src/share/classes/java/lang/ClassLoader.java Mon Dec 20 13:47:04 2010 -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. @@ -266,8 +266,7 @@ // The packages defined in this class loader. Each package name is mapped // to its corresponding Package object. // @GuardedBy("itself") - private final HashMap packages = - new HashMap(); + private final HashMap packages = new HashMap<>(); private static Void checkCreateClassLoader() { SecurityManager security = System.getSecurityManager(); @@ -280,16 +279,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 +1181,7 @@ } tmp[1] = findResources(name); - return new CompoundEnumeration(tmp); + return new CompoundEnumeration<>(tmp); } /** @@ -1657,7 +1656,7 @@ protected Package[] getPackages() { Map map; synchronized (packages) { - map = new HashMap(packages); + map = new HashMap<>(packages); } Package[] pkgs; if (parent != null) { @@ -1764,20 +1763,17 @@ } // All native library names we've loaded. - private static Vector loadedLibraryNames - = new Vector(); + private static Vector loadedLibraryNames = 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(); + private Vector nativeLibraries = new Vector<>(); // native libraries being loaded/unloaded. - private static Stack nativeLibraryContext - = new Stack(); + private static Stack nativeLibraryContext = new Stack<>(); // The paths searched for libraries private static String usr_paths[]; @@ -2101,8 +2097,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 +2160,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++)