--- old/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2014-02-05 11:39:19.562596912 -0800 +++ new/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2014-02-05 11:39:19.362596903 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ * List of stream positions for images, reinitialized every time * a new input source is set. */ - private List imagePositions = null; + private List imagePositions = null; /** * The number of images in the stream, or 0. @@ -223,9 +223,9 @@ private DisposerRecord disposerRecord; /** Sets up static C structures. */ - private static native void initReaderIDs(Class iisClass, - Class qTableClass, - Class huffClass); + private static native void initReaderIDs(Class iisClass, + Class qTableClass, + Class huffClass); public JPEGImageReader(ImageReaderSpi originator) { super(originator); @@ -375,7 +375,7 @@ currentImage = 0; } if (seekForwardOnly) { - Long pos = (Long) imagePositions.get(imagePositions.size()-1); + Long pos = imagePositions.get(imagePositions.size()-1); iis.flushBefore(pos.longValue()); } tablesOnlyChecked = true; @@ -481,12 +481,12 @@ checkTablesOnly(); } if (imageIndex < imagePositions.size()) { - iis.seek(((Long)(imagePositions.get(imageIndex))).longValue()); + iis.seek(imagePositions.get(imageIndex).longValue()); } else { // read to start of image, saving positions // First seek to the last position we already have, and skip the // entire image - Long pos = (Long) imagePositions.get(imagePositions.size()-1); + Long pos = imagePositions.get(imagePositions.size()-1); iis.seek(pos.longValue()); skipImage(); // Now add all intervening positions, skipping images @@ -766,7 +766,7 @@ } } - public Iterator getImageTypes(int imageIndex) + public Iterator getImageTypes(int imageIndex) throws IOException { setThreadLock(); try { @@ -776,7 +776,7 @@ } } - private Iterator getImageTypesOnThread(int imageIndex) + private Iterator getImageTypesOnThread(int imageIndex) throws IOException { if (currentImage != imageIndex) { cbLock.check(); @@ -1063,7 +1063,7 @@ if (!wantRaster){ // Can we read this image? - Iterator imageTypes = getImageTypes(imageIndex); + Iterator imageTypes = getImageTypes(imageIndex); if (imageTypes.hasNext() == false) { throw new IIOException("Unsupported Image Type"); } @@ -1187,7 +1187,7 @@ // and set knownPassCount if (imageIndex == imageMetadataIndex) { // We have metadata knownPassCount = 0; - for (Iterator iter = imageMetadata.markerSequence.iterator(); + for (Iterator iter = imageMetadata.markerSequence.iterator(); iter.hasNext();) { if (iter.next() instanceof SOSMarkerSegment) { knownPassCount++; @@ -1565,7 +1565,7 @@ // reset local Java structures numImages = 0; - imagePositions = new ArrayList(); + imagePositions = new ArrayList<>(); currentImage = -1; image = null; raster = null;