--- old/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java 2014-02-05 11:39:09.762596474 -0800 +++ new/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java 2014-02-05 11:39:09.572596466 -0800 @@ -72,7 +72,7 @@ // A List of Longs indicating the stream positions of the // start of the metadata for each image. Entries are added // as needed. - List imageStartPosition = new ArrayList(); + List imageStartPosition = new ArrayList<>(); // Length of metadata for image at 'currIndex', valid only if // imageMetadata != null. @@ -227,7 +227,7 @@ return new ImageTypeSpecifier(colorModel, sampleModel); } - public Iterator getImageTypes(int imageIndex) throws IIOException { + public Iterator getImageTypes(int imageIndex) throws IIOException { checkIndex(imageIndex); int index = locateImage(imageIndex); @@ -236,7 +236,7 @@ } readMetadata(); - List l = new ArrayList(1); + List l = new ArrayList<>(1); byte[] colorTable; if (imageMetadata.localColorTable != null) { @@ -605,7 +605,7 @@ int index = Math.min(imageIndex, imageStartPosition.size() - 1); // Seek to that position - Long l = (Long)imageStartPosition.get(index); + Long l = imageStartPosition.get(index); stream.seek(l.longValue()); // Skip images until at desired index or last image found @@ -731,7 +731,7 @@ } else if (label == 0xfe) { // Comment extension byte[] comment = concatenateBlocks(); if (imageMetadata.comments == null) { - imageMetadata.comments = new ArrayList(); + imageMetadata.comments = new ArrayList<>(); } imageMetadata.comments.add(comment); } else if (label == 0xff) { // Application extension @@ -762,10 +762,10 @@ // Init lists if necessary if (imageMetadata.applicationIDs == null) { - imageMetadata.applicationIDs = new ArrayList(); + imageMetadata.applicationIDs = new ArrayList<>(); imageMetadata.authenticationCodes = - new ArrayList(); - imageMetadata.applicationData = new ArrayList(); + new ArrayList<>(); + imageMetadata.applicationData = new ArrayList<>(); } imageMetadata.applicationIDs.add(applicationID); imageMetadata.authenticationCodes.add(authCode); @@ -868,7 +868,7 @@ } // Initialize the destination image - Iterator imageTypes = getImageTypes(imageIndex); + Iterator imageTypes = getImageTypes(imageIndex); this.theImage = getDestination(param, imageTypes, imageMetadata.imageWidth, @@ -1031,7 +1031,7 @@ streamMetadata = null; currIndex = -1; imageMetadata = null; - imageStartPosition = new ArrayList(); + imageStartPosition = new ArrayList<>(); numImages = -1; // No need to reinitialize 'block'