--- old/src/share/classes/com/sun/naming/internal/FactoryEnumeration.java 2011-07-27 17:25:50.825796900 -0700 +++ new/src/share/classes/com/sun/naming/internal/FactoryEnumeration.java 2011-07-27 17:25:49.554669800 -0700 @@ -37,7 +37,8 @@ // no need to implement Enumeration since this is only for internal use public final class FactoryEnumeration { - private List factories; + // List> + private List> factories; private int posn = 0; private ClassLoader loader; @@ -59,7 +60,8 @@ * @param factories A non-null list * @param loader The class loader of the list's contents */ - FactoryEnumeration(List factories, ClassLoader loader) { + FactoryEnumeration(List> factories, + ClassLoader loader) { this.factories = factories; this.loader = loader; } @@ -67,7 +69,7 @@ public Object next() throws NamingException { synchronized (factories) { - NamedWeakReference ref = (NamedWeakReference) factories.get(posn++); + NamedWeakReference ref = factories.get(posn++); Object answer = ref.get(); if ((answer != null) && !(answer instanceof Class)) { return answer; @@ -81,7 +83,7 @@ } // Instantiate Class to get factory answer = ((Class) answer).newInstance(); - ref = new NamedWeakReference(answer, className); + ref = new NamedWeakReference<>(answer, className); factories.set(posn-1, ref); // replace Class object or null return answer; } catch (ClassNotFoundException e) {