--- old/src/share/classes/javax/imageio/ImageReader.java 2014-02-20 15:25:08.394312057 -0800 +++ new/src/share/classes/javax/imageio/ImageReader.java 2014-02-20 15:25:08.244312052 -0800 @@ -793,7 +793,7 @@ } private IIOMetadata getMetadata(String formatName, - Set nodeNames, + Set nodeNames, boolean wantStream, int imageIndex) throws IOException { if (formatName == null) { @@ -1065,10 +1065,10 @@ BufferedImage im = read(imageIndex, param); - ArrayList thumbnails = null; + ArrayList thumbnails = null; int numThumbnails = getNumThumbnails(imageIndex); if (numThumbnails > 0) { - thumbnails = new ArrayList(); + thumbnails = new ArrayList<>(); for (int j = 0; j < numThumbnails; j++) { thumbnails.add(readThumbnail(imageIndex, j)); } @@ -1156,7 +1156,7 @@ readAll(Iterator params) throws IOException { - List output = new ArrayList(); + List output = new ArrayList<>(); int imageIndex = getMinIndex(); @@ -1187,10 +1187,10 @@ break; } - ArrayList thumbnails = null; + ArrayList thumbnails = null; int numThumbnails = getNumThumbnails(imageIndex); if (numThumbnails > 0) { - thumbnails = new ArrayList(); + thumbnails = new ArrayList<>(); for (int j = 0; j < numThumbnails; j++) { thumbnails.add(readThumbnail(imageIndex, j)); } @@ -1797,9 +1797,9 @@ // Add an element to a list, creating a new list if the // existing list is null, and return the list. - static List addToList(List l, Object elt) { + static List addToList(List l, T elt) { if (l == null) { - l = new ArrayList(); + l = new ArrayList<>(); } l.add(elt); return l; @@ -1808,7 +1808,7 @@ // Remove an element from a list, discarding the list if the // resulting list is empty, and return the list or null. - static List removeFromList(List l, Object elt) { + static List removeFromList(List l, T elt) { if (l == null) { return l; } @@ -2461,10 +2461,10 @@ * If that throws MissingResourceException, then try the * system class loader. */ - ClassLoader loader = (ClassLoader) + ClassLoader loader = java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { + new java.security.PrivilegedAction() { + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } });