commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1417043 [19/21] - in /commons/proper/imaging/trunk/src: main/java/org/apache/commons/imaging/ main/java/org/apache/commons/imaging/color/ main/java/org/apache/commons/imaging/common/ main/java/org/apache/commons/imaging/common/bytesource/ ...
Date Tue, 04 Dec 2012 17:24:32 GMT
Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java Tue Dec  4 17:23:16 2012
@@ -70,10 +70,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     private class GeneratorFor1BitBitmaps implements BitmapGenerator {
-        public byte[] generateBitmap(int foreground, int background,
-                int paletteSize) throws IOException, ImageWriteException {
-            ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
+        public byte[] generateBitmap(final int foreground, final int background,
+                final int paletteSize) throws IOException, ImageWriteException {
+            final ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
                     ByteOrder.LITTLE_ENDIAN);
             // Palette
             bos.write3Bytes(background);
@@ -113,10 +113,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     private class GeneratorFor4BitBitmaps implements BitmapGenerator {
-        public byte[] generateBitmap(int foreground, int background,
-                int paletteSize) throws IOException, ImageWriteException {
-            ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
+        public byte[] generateBitmap(final int foreground, final int background,
+                final int paletteSize) throws IOException, ImageWriteException {
+            final ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
                     ByteOrder.LITTLE_ENDIAN);
             // Palette
             bos.write3Bytes(background);
@@ -147,10 +147,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     private class GeneratorFor8BitBitmaps implements BitmapGenerator {
-        public byte[] generateBitmap(int foreground, int background,
-                int paletteSize) throws IOException, ImageWriteException {
-            ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
+        public byte[] generateBitmap(final int foreground, final int background,
+                final int paletteSize) throws IOException, ImageWriteException {
+            final ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
                     ByteOrder.LITTLE_ENDIAN);
             // Palette
             bos.write3Bytes(background);
@@ -180,10 +180,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     private class GeneratorFor16BitBitmaps implements BitmapGenerator {
-        public byte[] generateBitmap(int foreground, int background,
-                int paletteSize) throws IOException, ImageWriteException {
-            ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
+        public byte[] generateBitmap(final int foreground, final int background,
+                final int paletteSize) throws IOException, ImageWriteException {
+            final ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
                     ByteOrder.LITTLE_ENDIAN);
             // Palette
             for (int i = 0; i < paletteSize; i++) {
@@ -217,10 +217,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     private class GeneratorFor24BitBitmaps implements BitmapGenerator {
-        public byte[] generateBitmap(int foreground, int background,
-                int paletteSize) throws IOException, ImageWriteException {
-            ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
+        public byte[] generateBitmap(final int foreground, final int background,
+                final int paletteSize) throws IOException, ImageWriteException {
+            final ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
                     ByteOrder.LITTLE_ENDIAN);
             // Palette
             for (int i = 0; i < paletteSize; i++) {
@@ -250,16 +250,16 @@ public class IcoRoundtripTest extends Ic
     }
 
     private class GeneratorFor32BitBitmaps implements BitmapGenerator {
-        public byte[] generateBitmap(int foreground, int background,
-                int paletteSize) throws IOException, ImageWriteException {
+        public byte[] generateBitmap(final int foreground, final int background,
+                final int paletteSize) throws IOException, ImageWriteException {
             return generate32bitRGBABitmap(foreground, background, paletteSize,
                     true);
         }
 
-        public byte[] generate32bitRGBABitmap(int foreground, int background,
-                int paletteSize, boolean writeMask) throws IOException {
-            ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
+        public byte[] generate32bitRGBABitmap(final int foreground, final int background,
+                final int paletteSize, final boolean writeMask) throws IOException {
+            final ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(byteArrayStream,
                     ByteOrder.LITTLE_ENDIAN);
             // Palette
             for (int i = 0; i < paletteSize; i++) {
@@ -290,16 +290,16 @@ public class IcoRoundtripTest extends Ic
         }
     }
 
-    private void writeICONDIR(BinaryOutputStream bos, int reserved, int type,
-            int count) throws IOException {
+    private void writeICONDIR(final BinaryOutputStream bos, final int reserved, final int type,
+            final int count) throws IOException {
         bos.write2Bytes(reserved);
         bos.write2Bytes(type);
         bos.write2Bytes(count);
     }
 
-    private void writeICONDIRENTRY(BinaryOutputStream bos, int width,
-            int height, int colorCount, int reserved, int planes, int bitCount,
-            int bytesInRes) throws IOException {
+    private void writeICONDIRENTRY(final BinaryOutputStream bos, final int width,
+            final int height, final int colorCount, final int reserved, final int planes, final int bitCount,
+            final int bytesInRes) throws IOException {
         bos.write(width);
         bos.write(height);
         bos.write(colorCount);
@@ -310,9 +310,9 @@ public class IcoRoundtripTest extends Ic
         bos.write4Bytes(22); // image comes immediately after this
     }
 
-    private void writeBITMAPINFOHEADER(BinaryOutputStream bos, int width,
-            int height, int colorPlanes, int bitCount, int compression,
-            int colorsUsed, int colorsImportant) throws IOException {
+    private void writeBITMAPINFOHEADER(final BinaryOutputStream bos, final int width,
+            final int height, final int colorPlanes, final int bitCount, final int compression,
+            final int colorsUsed, final int colorsImportant) throws IOException {
         // BITMAPINFOHEADER
         bos.write4Bytes(40); // biSize, always 40 for BITMAPINFOHEADER
         bos.write4Bytes(width); // biWidth
@@ -330,14 +330,14 @@ public class IcoRoundtripTest extends Ic
     public void testNormalIcons() throws Exception {
         final int foreground = 0xFFF000E0;
         final int background = 0xFF102030;
-        for (Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
-            int bitDepth = entry.getKey();
-            BitmapGenerator bitmapGenerator = entry.getValue();
+        for (final Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
+            final int bitDepth = entry.getKey();
+            final BitmapGenerator bitmapGenerator = entry.getValue();
 
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(baos,
+            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(baos,
                     ByteOrder.LITTLE_ENDIAN);
-            byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
+            final byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
                     background, (bitDepth <= 8) ? (1 << bitDepth) : 0);
             writeICONDIR(bos, 0, 1, 1);
             writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, bitDepth,
@@ -354,14 +354,14 @@ public class IcoRoundtripTest extends Ic
         final int foreground = 0xFFF000E0;
         final int background = 0xFF102030;
         // Windows ignores the ICONDIRENTRY values when parsing the ICO file.
-        for (Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
-            int bitDepth = entry.getKey();
-            BitmapGenerator bitmapGenerator = entry.getValue();
+        for (final Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
+            final int bitDepth = entry.getKey();
+            final BitmapGenerator bitmapGenerator = entry.getValue();
 
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(baos,
+            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(baos,
                     ByteOrder.LITTLE_ENDIAN);
-            byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
+            final byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
                     background, (bitDepth <= 8) ? (1 << bitDepth) : 0);
             writeICONDIR(bos, 0, 1, 1);
             writeICONDIRENTRY(bos, 3 /* width, should be 16 */, 4 /*
@@ -396,14 +396,14 @@ public class IcoRoundtripTest extends Ic
     public void testColorsUsed() throws Exception {
         final int foreground = 0xFFF000E0;
         final int background = 0xFF102030;
-        for (Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
-            int bitDepth = entry.getKey();
-            BitmapGenerator bitmapGenerator = entry.getValue();
+        for (final Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
+            final int bitDepth = entry.getKey();
+            final BitmapGenerator bitmapGenerator = entry.getValue();
 
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(baos,
+            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(baos,
                     ByteOrder.LITTLE_ENDIAN);
-            byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
+            final byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
                     background, 2);
             writeICONDIR(bos, 0, 1, 1);
             writeICONDIRENTRY(bos, 3, 4, 7, 20, 11, 19, 40 + bitmap.length);
@@ -418,14 +418,14 @@ public class IcoRoundtripTest extends Ic
     public void testZeroColorPlanes() throws Exception {
         final int foreground = 0xFFF000E0;
         final int background = 0xFF102030;
-        for (Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
-            int bitDepth = entry.getKey();
-            BitmapGenerator bitmapGenerator = entry.getValue();
+        for (final Map.Entry<Integer,BitmapGenerator> entry : generatorMap.entrySet()) {
+            final int bitDepth = entry.getKey();
+            final BitmapGenerator bitmapGenerator = entry.getValue();
 
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            BinaryOutputStream bos = new BinaryOutputStream(baos,
+            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            final BinaryOutputStream bos = new BinaryOutputStream(baos,
                     ByteOrder.LITTLE_ENDIAN);
-            byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
+            final byte[] bitmap = bitmapGenerator.generateBitmap(foreground,
                     background, (bitDepth <= 8) ? (1 << bitDepth) : 0);
             writeICONDIR(bos, 0, 1, 1);
             writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, bitDepth,
@@ -440,7 +440,7 @@ public class IcoRoundtripTest extends Ic
                 writeAndReadImageData(
                         "16x16x" + bitDepth + "-zero-colorPlanes",
                         baos.toByteArray(), foreground, background);
-            } catch (ImageReadException imageReadException) {
+            } catch (final ImageReadException imageReadException) {
                 threw = true;
             }
             assertTrue(threw);
@@ -448,10 +448,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     public void testBitfieldCompression() throws Exception {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        BinaryOutputStream bos = new BinaryOutputStream(baos,
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final BinaryOutputStream bos = new BinaryOutputStream(baos,
                 ByteOrder.LITTLE_ENDIAN);
-        byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
+        final byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
                 0xFFFF0000, 0xFFFFFFFF, 0, true);
         writeICONDIR(bos, 0, 1, 1);
         writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
@@ -469,11 +469,11 @@ public class IcoRoundtripTest extends Ic
     public void test32bitMask() throws Exception {
         final int foreground = 0xFFF000E0;
         final int background = 0xFF102030;
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        BinaryOutputStream bos = new BinaryOutputStream(baos,
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final BinaryOutputStream bos = new BinaryOutputStream(baos,
                 ByteOrder.LITTLE_ENDIAN);
         // For 32 bit RGBA, the AND mask can be missing:
-        byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
+        final byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
                 foreground, background, 0, false);
         writeICONDIR(bos, 0, 1, 1);
         writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
@@ -485,10 +485,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     public void testAlphaVersusANDMask() throws Exception {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        BinaryOutputStream bos = new BinaryOutputStream(baos,
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final BinaryOutputStream bos = new BinaryOutputStream(baos,
                 ByteOrder.LITTLE_ENDIAN);
-        byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
+        final byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
                 0xFF000000, 0x00000000, 0, true);
         writeICONDIR(bos, 0, 1, 1);
         writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
@@ -502,10 +502,10 @@ public class IcoRoundtripTest extends Ic
     }
 
     public void testFullyTransparent32bitRGBA() throws Exception {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        BinaryOutputStream bos = new BinaryOutputStream(baos,
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final BinaryOutputStream bos = new BinaryOutputStream(baos,
                 ByteOrder.LITTLE_ENDIAN);
-        byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
+        final byte[] bitmap = new GeneratorFor32BitBitmaps().generate32bitRGBABitmap(
                 0x00000000, 0x00FFFFFF, 0, true);
         writeICONDIR(bos, 0, 1, 1);
         writeICONDIRENTRY(bos, 16, 16, 0, 0, 1, 32, 40 + bitmap.length);
@@ -517,17 +517,17 @@ public class IcoRoundtripTest extends Ic
                 0xFF000000, 0xFFFFFFFF);
     }
 
-    private void writeAndReadImageData(String description, byte[] rawData,
-            int foreground, int background) throws IOException,
+    private void writeAndReadImageData(final String description, final byte[] rawData,
+            final int foreground, final int background) throws IOException,
             ImageReadException {
         // Uncomment to generate ICO files that can be tested with Windows:
         // File exportFile = new File("/tmp/" + description + ".ico");
         // IoUtils.writeToFile(rawData, exportFile);
 
-        File tempFile = createTempFile("temp", ".ico");
+        final File tempFile = createTempFile("temp", ".ico");
         IoUtils.writeToFile(rawData, tempFile);
 
-        BufferedImage dstImage = Imaging.getBufferedImage(tempFile);
+        final BufferedImage dstImage = Imaging.getBufferedImage(tempFile);
 
         assertNotNull(dstImage);
         assertTrue(dstImage.getWidth() == image[0].length);
@@ -536,15 +536,15 @@ public class IcoRoundtripTest extends Ic
         verify(dstImage, foreground, background);
     }
 
-    private void verify(BufferedImage data, int foreground, int background) {
+    private void verify(final BufferedImage data, final int foreground, final int background) {
         assertNotNull(data);
         assertTrue(data.getHeight() == image.length);
 
         for (int y = 0; y < data.getHeight(); y++) {
             assertTrue(data.getWidth() == image[y].length);
             for (int x = 0; x < data.getWidth(); x++) {
-                int imageARGB = (image[y][x] == 1) ? foreground : background;
-                int dataARGB = data.getRGB(x, y);
+                final int imageARGB = (image[y][x] == 1) ? foreground : background;
+                final int dataARGB = data.getRGB(x, y);
 
                 if (imageARGB != dataARGB) {
                     Debug.debug("x: " + x + ", y: " + y + ", image: "

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegBaseTest.java Tue Dec  4 17:23:16 2012
@@ -28,14 +28,14 @@ import org.apache.commons.imaging.Imagin
 
 public abstract class JpegBaseTest extends ImagingTest {
 
-    protected static boolean isJpeg(File file) throws IOException,
+    protected static boolean isJpeg(final File file) throws IOException,
             ImageReadException {
-        ImageFormat format = Imaging.guessFormat(file);
+        final ImageFormat format = Imaging.guessFormat(file);
         return format == ImageFormat.IMAGE_FORMAT_JPEG;
     }
 
     public static final ImageFilter imageFilter = new ImageFilter() {
-        public boolean accept(File file) throws IOException, ImageReadException {
+        public boolean accept(final File file) throws IOException, ImageReadException {
             return isJpeg(file);
         }
     };

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegReadTest.java Tue Dec  4 17:23:16 2012
@@ -32,35 +32,35 @@ import org.apache.commons.imaging.util.D
 public class JpegReadTest extends JpegBaseTest {
 
     public void test() throws Exception {
-        List<File> images = getJpegImages();
+        final List<File> images = getJpegImages();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile.getAbsoluteFile());
 
             // ByteSource byteSource = new ByteSourceFile(imageFile);
             // new JpegUtils().dumpJFIF(byteSource);
 
-            Map<String,Object> params = new HashMap<String,Object>();
-            boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+            final Map<String,Object> params = new HashMap<String,Object>();
+            final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
             params.put(PARAM_KEY_READ_THUMBNAILS, new Boolean(!ignoreImageData));
 
-            IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
+            final IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
             // assertNotNull(metadata);
             Debug.debug("metadata", metadata);
             
             Debug.debug("ICC profile", Imaging.getICCProfile(imageFile, params));
 
-            ImageInfo imageInfo = Imaging.getImageInfo(imageFile, params);
+            final ImageInfo imageInfo = Imaging.getImageInfo(imageFile, params);
             assertNotNull(imageInfo);
             
             try {
-                BufferedImage image = Imaging.getBufferedImage(imageFile, params);
+                final BufferedImage image = Imaging.getBufferedImage(imageFile, params);
                 assertNotNull(image);
-            } catch (ImageReadException imageReadException) {
+            } catch (final ImageReadException imageReadException) {
                 assertEquals("Only sequential, baseline JPEGs are supported at the moment",
                         imageReadException.getMessage());
             }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/JpegWithJpegThumbnailTest.java Tue Dec  4 17:23:16 2012
@@ -30,13 +30,13 @@ import org.apache.commons.imaging.format
 public class JpegWithJpegThumbnailTest extends ImagingTest {
 
     public void testSingleImage() throws Exception {
-        File imageFile = getTestImageByName("img_F028c_small.jpg");
+        final File imageFile = getTestImageByName("img_F028c_small.jpg");
 
-        Map<String,Object> params = new HashMap<String,Object>();
-        IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
+        final Map<String,Object> params = new HashMap<String,Object>();
+        final IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
         assertNotNull(metadata);
-        JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
-        BufferedImage image = jpegMetadata.getEXIFThumbnail();
+        final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
+        final BufferedImage image = jpegMetadata.getEXIFThumbnail();
         assertNotNull(image);
     }
 }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/decoder/DctTest.java Tue Dec  4 17:23:16 2012
@@ -21,19 +21,19 @@ import junit.framework.TestCase;
 
 public class DctTest extends TestCase {
     public void testVectors() throws Exception {
-        float[] originalData = new float[8];
+        final float[] originalData = new float[8];
         for (int i = 0; i < 8; i++) {
             originalData[i] = i;
         }
 
-        float[] transformed = REFERENCE_forwardDCT(originalData);
-        float[] reversed = REFERENCE_inverseDCT(transformed);
+        final float[] transformed = REFERENCE_forwardDCT(originalData);
+        final float[] reversed = REFERENCE_inverseDCT(transformed);
         for (int i = 0; i < 8; i++) {
             assertEquals("Reference transforms broken, at x=" + i,
                     originalData[i], reversed[i], 0.001);
         }
 
-        float[] data = originalData.clone();
+        final float[] data = originalData.clone();
         Dct.forwardDCT8(data);
         Dct.scaleQuantizationVector(data);
         for (int i = 0; i < 8; i++) {
@@ -50,18 +50,18 @@ public class DctTest extends TestCase {
     }
 
     public void testMatrices() throws Exception {
-        float[] originalData = new float[8 * 8];
-        float[][] originalData8x8 = new float[8][8];
+        final float[] originalData = new float[8 * 8];
+        final float[][] originalData8x8 = new float[8][8];
         for (int y = 0; y < 8; y++) {
             for (int x = 0; x < 8; x++) {
-                float value = 8 * y + x;
+                final float value = 8 * y + x;
                 originalData8x8[y][x] = value;
                 originalData[8 * y + x] = value;
             }
         }
 
-        float[][] transformed8x8 = REFERENCE_forwardDCT(originalData8x8);
-        float[][] reversed8x8 = REFERENCE_inverseDCT(transformed8x8);
+        final float[][] transformed8x8 = REFERENCE_forwardDCT(originalData8x8);
+        final float[][] reversed8x8 = REFERENCE_inverseDCT(transformed8x8);
         for (int y = 0; y < 8; y++) {
             for (int x = 0; x < 8; x++) {
                 assertEquals("Reference transforms broken, at x=" + x + ",y="
@@ -69,7 +69,7 @@ public class DctTest extends TestCase {
             }
         }
 
-        float[] data = originalData.clone();
+        final float[] data = originalData.clone();
         Dct.forwardDCT8x8(data);
         Dct.scaleQuantizationMatrix(data);
         for (int y = 0; y < 8; y++) {
@@ -89,16 +89,16 @@ public class DctTest extends TestCase {
         }
     }
 
-    private static float[][] REFERENCE_inverseDCT(float[][] matrix) {
-        float[][] ret = new float[8][8];
+    private static float[][] REFERENCE_inverseDCT(final float[][] matrix) {
+        final float[][] ret = new float[8][8];
         for (int y = 0; y < 8; y++) {
             for (int x = 0; x < 8; x++) {
                 float sum = 0;
                 for (int u = 0; u < 8; u++) {
                     for (int v = 0; v < 8; v++) {
-                        float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2)))
+                        final float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2)))
                                 : 1;
-                        float cv = (v == 0) ? ((float) (1.0 / Math.sqrt(2)))
+                        final float cv = (v == 0) ? ((float) (1.0 / Math.sqrt(2)))
                                 : 1;
                         sum += cu * cv * matrix[v][u]
                                 * Math.cos((2 * x + 1) * u * Math.PI / 16)
@@ -111,12 +111,12 @@ public class DctTest extends TestCase {
         return ret;
     }
 
-    private static float[] REFERENCE_inverseDCT(float[] vector) {
-        float[] ret = new float[8];
+    private static float[] REFERENCE_inverseDCT(final float[] vector) {
+        final float[] ret = new float[8];
         for (int x = 0; x < 8; x++) {
             float sum = 0;
             for (int u = 0; u < 8; u++) {
-                float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
+                final float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
                 sum += cu * vector[u]
                         * Math.cos((2 * x + 1) * u * Math.PI / 16);
             }
@@ -125,13 +125,13 @@ public class DctTest extends TestCase {
         return ret;
     }
 
-    private static float[][] REFERENCE_forwardDCT(float[][] matrix) {
-        float[][] ret = new float[8][8];
+    private static float[][] REFERENCE_forwardDCT(final float[][] matrix) {
+        final float[][] ret = new float[8][8];
         for (int u = 0; u < 8; u++) {
             for (int v = 0; v < 8; v++) {
                 float sum = 0;
-                float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
-                float cv = (v == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
+                final float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
+                final float cv = (v == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
                 for (int x = 0; x < 8; x++) {
                     for (int y = 0; y < 8; y++) {
                         sum += matrix[y][x]
@@ -145,11 +145,11 @@ public class DctTest extends TestCase {
         return ret;
     }
 
-    private static float[] REFERENCE_forwardDCT(float[] vector) {
-        float[] ret = new float[8];
+    private static float[] REFERENCE_forwardDCT(final float[] vector) {
+        final float[] ret = new float[8];
         for (int u = 0; u < 8; u++) {
             float sum = 0;
-            float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
+            final float cu = (u == 0) ? ((float) (1.0 / Math.sqrt(2))) : 1;
             for (int x = 0; x < 8; x++) {
                 sum += vector[x] * Math.cos((2 * x + 1) * u * Math.PI / 16);
             }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/AsciiFieldTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/AsciiFieldTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/AsciiFieldTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/AsciiFieldTest.java Tue Dec  4 17:23:16 2012
@@ -35,31 +35,31 @@ import org.apache.commons.imaging.format
 public class AsciiFieldTest extends ExifBaseTest implements AllTagConstants {
 
     public void testSingleImage() throws Exception {
-        File imageFile = getTestImageByName("Canon Powershot SD750 - 2007.12.26.n.IMG_3704.JPG");
+        final File imageFile = getTestImageByName("Canon Powershot SD750 - 2007.12.26.n.IMG_3704.JPG");
 
-        Map<String,Object> params = new HashMap<String,Object>();
+        final Map<String,Object> params = new HashMap<String,Object>();
 
-        IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
+        final IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
         assertNotNull(metadata);
-        JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
+        final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
 
         // note that exif might be null if no Exif metadata is found.
-        TiffImageMetadata exif = jpegMetadata.getExif();
+        final TiffImageMetadata exif = jpegMetadata.getExif();
         if (null == exif) {
             return;
         }
 
-        List<TiffField> fields = exif.getAllFields();
-        Map<Integer,TiffField> fieldMap = new Hashtable<Integer,TiffField>();
+        final List<TiffField> fields = exif.getAllFields();
+        final Map<Integer,TiffField> fieldMap = new Hashtable<Integer,TiffField>();
         // Build a simplified field tag -> field map, ignoring directory
         // structures.
         // Good enough for our purposes, since the image in question is known.
         for (int i = 0; i < fields.size(); i++) {
-            TiffField field = fields.get(i);
+            final TiffField field = fields.get(i);
             fieldMap.put(field.tag, field);
         }
 
-        Map<Integer,Object> expectedFieldValues = new Hashtable<Integer,Object>();
+        final Map<Integer,Object> expectedFieldValues = new Hashtable<Integer,Object>();
         expectedFieldValues.put(
                 TiffTagConstants.TIFF_TAG_MAKE.tag, "Canon");
         expectedFieldValues.put(
@@ -68,15 +68,15 @@ public class AsciiFieldTest extends Exif
         expectedFieldValues.put(
                 TiffTagConstants.TIFF_TAG_DATE_TIME.tag,
                 "2007:12:25 13:34:39");
-        Iterator<Integer> expectedTags = expectedFieldValues.keySet().iterator();
+        final Iterator<Integer> expectedTags = expectedFieldValues.keySet().iterator();
         while (expectedTags.hasNext()) {
-            Integer tag = expectedTags.next();
-            Object expectedValue = expectedFieldValues.get(tag);
+            final Integer tag = expectedTags.next();
+            final Object expectedValue = expectedFieldValues.get(tag);
 
             assertTrue(fieldMap.containsKey(tag));
-            TiffField field = fieldMap.get(tag);
+            final TiffField field = fieldMap.get(tag);
             assertNotNull(field);
-            Object value = field.getValue();
+            final Object value = field.getValue();
             assertNotNull(value);
             assertEquals(value, expectedValue);
         }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifBaseTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifBaseTest.java Tue Dec  4 17:23:16 2012
@@ -33,7 +33,7 @@ public abstract class ExifBaseTest exten
     // super(name);
     // }
 
-    protected static boolean hasExifData(File file) {
+    protected static boolean hasExifData(final File file) {
         // Debug.debug("hasExifData file", file.getAbsoluteFile());
 
         if (!file.getName().toLowerCase().endsWith(".jpg"))
@@ -47,9 +47,9 @@ public abstract class ExifBaseTest exten
         // Debug.debug("possible file", file);
 
         try {
-            ByteSource byteSource = new ByteSourceFile(file);
+            final ByteSource byteSource = new ByteSourceFile(file);
             return new JpegImageParser().hasExifSegment(byteSource);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             // Debug.debug("Error file", file.getAbsoluteFile());
             // Debug.debug(e, 4);
             return false;
@@ -57,13 +57,13 @@ public abstract class ExifBaseTest exten
     }
 
     private static final ImageFilter HAS_EXIF_IMAGE_FILTER = new ImageFilter() {
-        public boolean accept(File file) throws IOException, ImageReadException {
+        public boolean accept(final File file) throws IOException, ImageReadException {
             return hasExifData(file);
         }
     };
 
     private static final ImageFilter JPEG_IMAGE_FILTER = new ImageFilter() {
-        public boolean accept(File file) throws IOException, ImageReadException {
+        public boolean accept(final File file) throws IOException, ImageReadException {
             return file.getName().toLowerCase().endsWith(".jpg");
         }
     };
@@ -78,7 +78,7 @@ public abstract class ExifBaseTest exten
         return getTestImages(HAS_EXIF_IMAGE_FILTER);
     }
 
-    protected List<File> getImagesWithExifData(int max) throws IOException,
+    protected List<File> getImagesWithExifData(final int max) throws IOException,
             ImageReadException {
         return getTestImages(HAS_EXIF_IMAGE_FILTER, max);
     }
@@ -91,7 +91,7 @@ public abstract class ExifBaseTest exten
         return getTestImages(JPEG_IMAGE_FILTER);
     }
 
-    protected List<File> getJpegImages(int max) throws IOException,
+    protected List<File> getJpegImages(final int max) throws IOException,
             ImageReadException {
         return getTestImages(JPEG_IMAGE_FILTER, max);
     }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifDumpTest.java Tue Dec  4 17:23:16 2012
@@ -36,25 +36,25 @@ public class ExifDumpTest extends ExifBa
     // }
 
     public void test() throws Exception {
-        List<File> images = getImagesWithExifData();
+        final List<File> images = getImagesWithExifData();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile);
             Debug.debug();
 
-            ByteSource byteSource = new ByteSourceFile(imageFile);
+            final ByteSource byteSource = new ByteSourceFile(imageFile);
             Debug.debug("Segments:");
             new JpegUtils().dumpJFIF(byteSource);
 
-            Map<String,Object> params = new HashMap<String,Object>();
-            boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+            final Map<String,Object> params = new HashMap<String,Object>();
+            final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
             params.put(PARAM_KEY_READ_THUMBNAILS, new Boolean(!ignoreImageData));
 
-            JpegImageMetadata metadata = (JpegImageMetadata) Imaging
+            final JpegImageMetadata metadata = (JpegImageMetadata) Imaging
                     .getMetadata(imageFile, params);
             if (null == metadata)
              {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriteTest.java Tue Dec  4 17:23:16 2012
@@ -53,35 +53,35 @@ public class ExifRewriteTest extends Exi
     // }
 
     public void testRemove() throws Exception {
-        List<File> images = getImagesWithExifData();
+        final List<File> images = getImagesWithExifData();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile);
 
-            boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+            final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
             if (ignoreImageData) {
                 continue;
             }
 
-            ByteSource byteSource = new ByteSourceFile(imageFile);
+            final ByteSource byteSource = new ByteSourceFile(imageFile);
             Debug.debug("Source Segments:");
             new JpegUtils().dumpJFIF(byteSource);
 
             {
-                JpegImageMetadata metadata = (JpegImageMetadata) Imaging
+                final JpegImageMetadata metadata = (JpegImageMetadata) Imaging
                         .getMetadata(imageFile);
                 // assertNotNull(metadata.getExif());
             }
 
             {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 new ExifRewriter().removeExifMetadata(byteSource, baos);
-                byte bytes[] = baos.toByteArray();
-                File tempFile = createTempFile("test", ".jpg");
+                final byte bytes[] = baos.toByteArray();
+                final File tempFile = createTempFile("test", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 IoUtils.writeToFile(bytes, tempFile);
 
@@ -94,37 +94,37 @@ public class ExifRewriteTest extends Exi
     }
 
     public void testInsert() throws Exception {
-        List<File> images = getImagesWithExifData();
+        final List<File> images = getImagesWithExifData();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile);
 
-            boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+            final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
             if (ignoreImageData) {
                 continue;
             }
 
-            ByteSource byteSource = new ByteSourceFile(imageFile);
+            final ByteSource byteSource = new ByteSourceFile(imageFile);
             Debug.debug("Source Segments:");
             new JpegUtils().dumpJFIF(byteSource);
 
-            JpegImageMetadata originalMetadata = (JpegImageMetadata) Imaging
+            final JpegImageMetadata originalMetadata = (JpegImageMetadata) Imaging
                     .getMetadata(imageFile);
             assertNotNull(originalMetadata);
 
-            TiffImageMetadata oldExifMetadata = originalMetadata.getExif();
+            final TiffImageMetadata oldExifMetadata = originalMetadata.getExif();
             assertNotNull(oldExifMetadata);
 
             ByteSource stripped;
             {
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 new ExifRewriter().removeExifMetadata(byteSource, baos);
-                byte bytes[] = baos.toByteArray();
-                File tempFile = createTempFile("removed", ".jpg");
+                final byte bytes[] = baos.toByteArray();
+                final File tempFile = createTempFile("removed", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 IoUtils.writeToFile(bytes, tempFile);
 
@@ -136,16 +136,16 @@ public class ExifRewriteTest extends Exi
             }
 
             {
-                TiffOutputSet outputSet = oldExifMetadata.getOutputSet();
+                final TiffOutputSet outputSet = oldExifMetadata.getOutputSet();
                 // outputSet.dump();
 
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
                 new ExifRewriter().updateExifMetadataLossy(stripped, baos,
                         outputSet);
 
-                byte bytes[] = baos.toByteArray();
-                File tempFile = createTempFile("inserted" + "_", ".jpg");
+                final byte bytes[] = baos.toByteArray();
+                final File tempFile = createTempFile("inserted" + "_", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 IoUtils.writeToFile(bytes, tempFile);
 
@@ -154,10 +154,10 @@ public class ExifRewriteTest extends Exi
 
                 // assertTrue(!hasExifData(tempFile));
 
-                JpegImageMetadata newMetadata = (JpegImageMetadata) Imaging
+                final JpegImageMetadata newMetadata = (JpegImageMetadata) Imaging
                         .getMetadata(tempFile);
                 assertNotNull(newMetadata);
-                TiffImageMetadata newExifMetadata = newMetadata.getExif();
+                final TiffImageMetadata newExifMetadata = newMetadata.getExif();
                 assertNotNull(newExifMetadata);
                 // newMetadata.dump();
 
@@ -173,37 +173,37 @@ public class ExifRewriteTest extends Exi
                 IOException, ImageWriteException;
     }
 
-    private void rewrite(Rewriter rewriter, String name) throws IOException,
+    private void rewrite(final Rewriter rewriter, final String name) throws IOException,
             ImageReadException, ImageWriteException {
-        List<File> images = getImagesWithExifData();
+        final List<File> images = getImagesWithExifData();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
 
             try {
 
                 Debug.debug("imageFile", imageFile);
 
-                boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+                final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
                 if (ignoreImageData) {
                     continue;
                 }
 
-                ByteSource byteSource = new ByteSourceFile(imageFile);
+                final ByteSource byteSource = new ByteSourceFile(imageFile);
                 Debug.debug("Source Segments:");
                 new JpegUtils().dumpJFIF(byteSource);
 
-                JpegImageMetadata oldMetadata = (JpegImageMetadata) Imaging
+                final JpegImageMetadata oldMetadata = (JpegImageMetadata) Imaging
                         .getMetadata(imageFile);
                 if (null == oldMetadata) {
                     continue;
                 }
                 assertNotNull(oldMetadata);
 
-                TiffImageMetadata oldExifMetadata = oldMetadata.getExif();
+                final TiffImageMetadata oldExifMetadata = oldMetadata.getExif();
                 if (null == oldExifMetadata) {
                     continue;
                 }
@@ -213,13 +213,13 @@ public class ExifRewriteTest extends Exi
                 // TiffImageMetadata tiffImageMetadata = metadata.getExif();
                 // Photoshop photoshop = metadata.getPhotoshop();
 
-                TiffOutputSet outputSet = oldExifMetadata.getOutputSet();
+                final TiffOutputSet outputSet = oldExifMetadata.getOutputSet();
                 // outputSet.dump();
 
-                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 rewriter.rewrite(byteSource, baos, outputSet);
-                byte bytes[] = baos.toByteArray();
-                File tempFile = createTempFile(name + "_", ".jpg");
+                final byte bytes[] = baos.toByteArray();
+                final File tempFile = createTempFile(name + "_", ".jpg");
                 Debug.debug("tempFile", tempFile);
                 IoUtils.writeToFile(bytes, tempFile);
 
@@ -228,23 +228,23 @@ public class ExifRewriteTest extends Exi
 
                 // assertTrue(!hasExifData(tempFile));
 
-                JpegImageMetadata newMetadata = (JpegImageMetadata) Imaging
+                final JpegImageMetadata newMetadata = (JpegImageMetadata) Imaging
                         .getMetadata(tempFile);
                 assertNotNull(newMetadata);
-                TiffImageMetadata newExifMetadata = newMetadata.getExif();
+                final TiffImageMetadata newExifMetadata = newMetadata.getExif();
                 assertNotNull(newExifMetadata);
                 // newMetadata.dump();
 
                 compare(imageFile, oldExifMetadata, newExifMetadata);
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 Debug.debug("imageFile", imageFile.getAbsoluteFile());
                 Debug.debug(e);
                 throw e;
-            } catch (ImageReadException e) {
+            } catch (final ImageReadException e) {
                 Debug.debug("imageFile", imageFile.getAbsoluteFile());
                 Debug.debug(e);
                 throw e;
-            } catch (ImageWriteException e) {
+            } catch (final ImageWriteException e) {
                 Debug.debug("imageFile", imageFile.getAbsoluteFile());
                 Debug.debug(e);
                 // FIXME: this image has 28kB of Maker Notes, causing the APP1
@@ -260,9 +260,9 @@ public class ExifRewriteTest extends Exi
     }
 
     public void testRewriteLossy() throws Exception {
-        Rewriter rewriter = new Rewriter() {
-            public void rewrite(ByteSource byteSource, OutputStream os,
-                    TiffOutputSet outputSet) throws ImageReadException,
+        final Rewriter rewriter = new Rewriter() {
+            public void rewrite(final ByteSource byteSource, final OutputStream os,
+                    final TiffOutputSet outputSet) throws ImageReadException,
                     IOException, ImageWriteException {
                 new ExifRewriter().updateExifMetadataLossy(byteSource, os,
                         outputSet);
@@ -273,9 +273,9 @@ public class ExifRewriteTest extends Exi
     }
 
     public void testRewriteLossless() throws Exception {
-        Rewriter rewriter = new Rewriter() {
-            public void rewrite(ByteSource byteSource, OutputStream os,
-                    TiffOutputSet outputSet) throws ImageReadException,
+        final Rewriter rewriter = new Rewriter() {
+            public void rewrite(final ByteSource byteSource, final OutputStream os,
+                    final TiffOutputSet outputSet) throws ImageReadException,
                     IOException, ImageWriteException {
                 new ExifRewriter().updateExifMetadataLossless(byteSource, os,
                         outputSet);
@@ -285,21 +285,21 @@ public class ExifRewriteTest extends Exi
         rewrite(rewriter, "lossless");
     }
 
-    private Hashtable<Integer,TiffImageMetadata.Directory> makeDirectoryMap(List<? extends IImageMetadataItem> directories) {
-        Hashtable<Integer,TiffImageMetadata.Directory> directoryMap = new Hashtable<Integer,TiffImageMetadata.Directory>();
+    private Hashtable<Integer,TiffImageMetadata.Directory> makeDirectoryMap(final List<? extends IImageMetadataItem> directories) {
+        final Hashtable<Integer,TiffImageMetadata.Directory> directoryMap = new Hashtable<Integer,TiffImageMetadata.Directory>();
         for (int i = 0; i < directories.size(); i++) {
-            TiffImageMetadata.Directory directory = (TiffImageMetadata.Directory) directories
+            final TiffImageMetadata.Directory directory = (TiffImageMetadata.Directory) directories
                     .get(i);
             directoryMap.put(directory.type, directory);
         }
         return directoryMap;
     }
 
-    private Hashtable<Integer,TiffField> makeFieldMap(List<? extends IImageMetadataItem> items) {
-        Hashtable<Integer,TiffField> fieldMap = new Hashtable<Integer,TiffField>();
+    private Hashtable<Integer,TiffField> makeFieldMap(final List<? extends IImageMetadataItem> items) {
+        final Hashtable<Integer,TiffField> fieldMap = new Hashtable<Integer,TiffField>();
         for (int i = 0; i < items.size(); i++) {
-            TiffImageMetadata.Item item = (TiffImageMetadata.Item) items.get(i);
-            TiffField field = item.getTiffField();
+            final TiffImageMetadata.Item item = (TiffImageMetadata.Item) items.get(i);
+            final TiffField field = item.getTiffField();
             if (!fieldMap.containsKey(field.tag)) {
                 fieldMap.put(field.tag, field);
             }
@@ -307,40 +307,40 @@ public class ExifRewriteTest extends Exi
         return fieldMap;
     }
 
-    private void compare(File imageFile, TiffImageMetadata oldExifMetadata,
-            TiffImageMetadata newExifMetadata) throws ImageReadException {
+    private void compare(final File imageFile, final TiffImageMetadata oldExifMetadata,
+            final TiffImageMetadata newExifMetadata) throws ImageReadException {
         assertNotNull(oldExifMetadata);
         assertNotNull(newExifMetadata);
 
-        List<? extends IImageMetadataItem> oldDirectories = oldExifMetadata.getDirectories();
-        List<? extends IImageMetadataItem> newDirectories = newExifMetadata.getDirectories();
+        final List<? extends IImageMetadataItem> oldDirectories = oldExifMetadata.getDirectories();
+        final List<? extends IImageMetadataItem> newDirectories = newExifMetadata.getDirectories();
 
         assertTrue(oldDirectories.size() == newDirectories.size());
 
-        Hashtable<Integer,TiffImageMetadata.Directory> oldDirectoryMap = makeDirectoryMap(oldDirectories);
-        Hashtable<Integer,TiffImageMetadata.Directory> newDirectoryMap = makeDirectoryMap(newDirectories);
+        final Hashtable<Integer,TiffImageMetadata.Directory> oldDirectoryMap = makeDirectoryMap(oldDirectories);
+        final Hashtable<Integer,TiffImageMetadata.Directory> newDirectoryMap = makeDirectoryMap(newDirectories);
 
         assertEquals(oldDirectories.size(), oldDirectoryMap.keySet().size());
-        List<Integer> oldDirectoryTypes = new ArrayList<Integer>(oldDirectoryMap.keySet());
+        final List<Integer> oldDirectoryTypes = new ArrayList<Integer>(oldDirectoryMap.keySet());
         Collections.sort(oldDirectoryTypes);
-        List<Integer> newDirectoryTypes = new ArrayList<Integer>(newDirectoryMap.keySet());
+        final List<Integer> newDirectoryTypes = new ArrayList<Integer>(newDirectoryMap.keySet());
         Collections.sort(newDirectoryTypes);
         assertEquals(oldDirectoryTypes, newDirectoryTypes);
 
         for (int i = 0; i < oldDirectoryTypes.size(); i++) {
-            Integer dirType = oldDirectoryTypes.get(i);
+            final Integer dirType = oldDirectoryTypes.get(i);
 
             // Debug.debug("dirType", dirType);
 
-            TiffImageMetadata.Directory oldDirectory = oldDirectoryMap
+            final TiffImageMetadata.Directory oldDirectory = oldDirectoryMap
                     .get(dirType);
-            TiffImageMetadata.Directory newDirectory = newDirectoryMap
+            final TiffImageMetadata.Directory newDirectory = newDirectoryMap
                     .get(dirType);
             assertNotNull(oldDirectory);
             assertNotNull(newDirectory);
 
-            List<? extends IImageMetadataItem> oldItems = oldDirectory.getItems();
-            List<? extends IImageMetadataItem> newItems = newDirectory.getItems();
+            final List<? extends IImageMetadataItem> oldItems = oldDirectory.getItems();
+            final List<? extends IImageMetadataItem> newItems = newDirectory.getItems();
 
             // Debug.debug("oldItems.size()", oldItems.size());
             // Debug.debug("newItems.size()", newItems.size());
@@ -355,13 +355,13 @@ public class ExifRewriteTest extends Exi
             // }
             // assertTrue(oldItems.size() == newItems.size());
 
-            Hashtable<Integer,TiffField> oldFieldMap = makeFieldMap(oldItems);
-            Hashtable<Integer,TiffField> newFieldMap = makeFieldMap(newItems);
+            final Hashtable<Integer,TiffField> oldFieldMap = makeFieldMap(oldItems);
+            final Hashtable<Integer,TiffField> newFieldMap = makeFieldMap(newItems);
 
-            Set<Integer> missingInNew = new HashSet<Integer>(oldFieldMap.keySet());
+            final Set<Integer> missingInNew = new HashSet<Integer>(oldFieldMap.keySet());
             missingInNew.removeAll(newFieldMap.keySet());
 
-            Set<Integer> missingInOld = new HashSet<Integer>(newFieldMap.keySet());
+            final Set<Integer> missingInOld = new HashSet<Integer>(newFieldMap.keySet());
             missingInOld.removeAll(oldFieldMap.keySet());
 
             // dump("missingInNew", missingInNew);
@@ -380,17 +380,17 @@ public class ExifRewriteTest extends Exi
             // assertEquals(oldFieldMap.keySet(), newFieldMap.keySet());
             // assertEquals(oldFieldMap.keySet(), newFieldMap.keySet());
 
-            List<Integer> oldFieldTags = new ArrayList<Integer>(oldFieldMap.keySet());
+            final List<Integer> oldFieldTags = new ArrayList<Integer>(oldFieldMap.keySet());
             Collections.sort(oldFieldTags);
-            List<Integer> newFieldTags = new ArrayList<Integer>(newFieldMap.keySet());
+            final List<Integer> newFieldTags = new ArrayList<Integer>(newFieldMap.keySet());
             Collections.sort(newFieldTags);
             assertEquals(oldFieldTags, newFieldTags);
 
             for (int j = 0; j < oldFieldTags.size(); j++) {
-                Integer fieldTag = oldFieldTags.get(j);
+                final Integer fieldTag = oldFieldTags.get(j);
 
-                TiffField oldField = oldFieldMap.get(fieldTag);
-                TiffField newField = newFieldMap.get(fieldTag);
+                final TiffField oldField = oldFieldMap.get(fieldTag);
+                final TiffField newField = newFieldMap.get(fieldTag);
 
                 // Debug.debug("fieldTag", fieldTag);
                 // Debug.debug("oldField", oldField);
@@ -408,9 +408,9 @@ public class ExifRewriteTest extends Exi
                     // Imaging currently doesn't correctly rewrite
                     // strings if any byte had the highest bit set,
                     // so if the source had that, all bets are off.
-                    byte[] rawBytes = oldField.fieldType.getRawBytes(oldField);
+                    final byte[] rawBytes = oldField.fieldType.getRawBytes(oldField);
                     boolean hasInvalidByte = false;
-                    for (byte rawByte : rawBytes) {
+                    for (final byte rawByte : rawBytes) {
                         if ((rawByte & 0x80) != 0) {
                             hasInvalidByte = true;
                             break;
@@ -452,7 +452,7 @@ public class ExifRewriteTest extends Exi
                         // Debug.debug("newField.valueOffsetBytes",
                         // newField.valueOffsetBytes);
 
-                        String label = imageFile.getName() + ", dirType[" + i
+                        final String label = imageFile.getName() + ", dirType[" + i
                                 + "]=" + dirType + ", fieldTag[" + j + "]="
                                 + fieldTag;
                         if (oldField.tag == 0x116 || oldField.tag == 0x117) {
@@ -489,8 +489,8 @@ public class ExifRewriteTest extends Exi
         }
     }
 
-    private void compare(String label, byte a[], byte b[], int aLength,
-            int bLength) {
+    private void compare(final String label, final byte a[], final byte b[], final int aLength,
+            final int bLength) {
         // Debug.debug("c0 a", a);
         // Debug.debug("c0 b", b);
         assertEquals(aLength, bLength);
@@ -499,7 +499,7 @@ public class ExifRewriteTest extends Exi
         assertNotNull(a);
         assertNotNull(b);
         assertEquals(a.length, b.length);
-        int length = aLength;
+        final int length = aLength;
         for (int i = 0; i < length; i++) {
             // byte ba = a[i];
             // byte bb = b[i];
@@ -518,17 +518,17 @@ public class ExifRewriteTest extends Exi
         }
     }
 
-    private void compare(String label, TiffField a, TiffField b)
+    private void compare(final String label, final TiffField a, final TiffField b)
             throws ImageReadException {
-        Object v1 = a.getValue();
-        Object v2 = b.getValue();
+        final Object v1 = a.getValue();
+        final Object v2 = b.getValue();
 
         // Debug.debug("v1", v1 + " (" + Debug.getType(v1) + ")");
         // Debug.debug("v2", v2 + " (" + Debug.getType(v2) + ")");
         assertEquals(label, v1, v2);
     }
 
-    private void compare(byte a[], byte b[]) {
+    private void compare(final byte a[], final byte b[]) {
         // Debug.debug("c1 a", a);
         // Debug.debug("c1 b", b);
         assertNotNull(a);

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/GpsTest.java Tue Dec  4 17:23:16 2012
@@ -32,13 +32,13 @@ public class GpsTest extends ExifBaseTes
 
     public void test() throws Exception {
 
-        List<File> images = getImagesWithExifData(300);
+        final List<File> images = getImagesWithExifData(300);
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
 
             // Debug.debug();
             // Debug.debug("imageFile", imageFile);
@@ -49,23 +49,23 @@ public class GpsTest extends ExifBaseTes
             }
 
             try {
-                Map<String,Object> params = new HashMap<String,Object>();
-                boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+                final Map<String,Object> params = new HashMap<String,Object>();
+                final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
                 params.put(PARAM_KEY_READ_THUMBNAILS, new Boolean(
                         !ignoreImageData));
 
-                JpegImageMetadata metadata = (JpegImageMetadata) Imaging
+                final JpegImageMetadata metadata = (JpegImageMetadata) Imaging
                         .getMetadata(imageFile, params);
                 if (null == metadata) {
                     continue;
                 }
 
-                TiffImageMetadata exifMetadata = metadata.getExif();
+                final TiffImageMetadata exifMetadata = metadata.getExif();
                 if (null == exifMetadata) {
                     continue;
                 }
 
-                TiffImageMetadata.GPSInfo gpsInfo = exifMetadata.getGPS();
+                final TiffImageMetadata.GPSInfo gpsInfo = exifMetadata.getGPS();
                 if (null == gpsInfo) {
                     continue;
                 }
@@ -78,7 +78,7 @@ public class GpsTest extends ExifBaseTes
                         gpsInfo.getLatitudeAsDegreesNorth());
 
                 Debug.debug();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 Debug.debug("imageFile", imageFile.getAbsoluteFile());
                 Debug.debug("imageFile", imageFile.length());
                 Debug.debug(e, 13);

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MakerNoteFieldTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MakerNoteFieldTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MakerNoteFieldTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/MakerNoteFieldTest.java Tue Dec  4 17:23:16 2012
@@ -33,7 +33,7 @@ public class MakerNoteFieldTest extends 
     // }
 
     @Override
-    protected void checkField(File imageFile, TiffField field)
+    protected void checkField(final File imageFile, final TiffField field)
             throws IOException, ImageReadException, ImageWriteException {
         if (field.tag != ExifTagConstants.EXIF_TAG_MAKER_NOTE.tag) {
             // if (field.tag == EXIF_TAG_EXIF_OFFSET.tag)

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/SpecificExifTagTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/SpecificExifTagTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/SpecificExifTagTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/SpecificExifTagTest.java Tue Dec  4 17:23:16 2012
@@ -41,18 +41,18 @@ public abstract class SpecificExifTagTes
     // }
 
     public void testSingleImage() throws Exception {
-        File imageFile = getImageWithExifData();
+        final File imageFile = getImageWithExifData();
         checkImage(imageFile);
     }
 
     public void testAllImages() throws Exception {
-        List<File> images = getImagesWithExifData();
+        final List<File> images = getImagesWithExifData();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             if (imageFile.getParentFile().getName().toLowerCase()
                     .equals("@broken")) {
                 continue;
@@ -64,30 +64,30 @@ public abstract class SpecificExifTagTes
     protected abstract void checkField(File imageFile, TiffField field)
             throws IOException, ImageReadException, ImageWriteException;
 
-    private void checkImage(File imageFile) throws IOException,
+    private void checkImage(final File imageFile) throws IOException,
             ImageReadException, ImageWriteException {
         // Debug.debug("imageFile", imageFile.getAbsoluteFile());
 
-        Map<String,Object> params = new HashMap<String,Object>();
-        boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+        final Map<String,Object> params = new HashMap<String,Object>();
+        final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
         params.put(PARAM_KEY_READ_THUMBNAILS, new Boolean(!ignoreImageData));
 
         // note that metadata might be null if no metadata is found.
-        IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
+        final IImageMetadata metadata = Imaging.getMetadata(imageFile, params);
         if (null == metadata) {
             return;
         }
-        JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
+        final JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
 
         // note that exif might be null if no Exif metadata is found.
-        TiffImageMetadata exif = jpegMetadata.getExif();
+        final TiffImageMetadata exif = jpegMetadata.getExif();
         if (null == exif) {
             return;
         }
 
-        List<TiffField> fields = exif.getAllFields();
+        final List<TiffField> fields = exif.getAllFields();
         for (int i = 0; i < fields.size(); i++) {
-            TiffField field = fields.get(i);
+            final TiffField field = fields.get(i);
             checkField(imageFile, field);
         }
 

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/TextFieldTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/TextFieldTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/TextFieldTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/TextFieldTest.java Tue Dec  4 17:23:16 2012
@@ -35,7 +35,7 @@ public class TextFieldTest extends Speci
     // }
 
     @Override
-    protected void checkField(File imageFile, TiffField field)
+    protected void checkField(final File imageFile, final TiffField field)
             throws IOException, ImageReadException, ImageWriteException {
         if (field.tag == ExifTagConstants.EXIF_TAG_USER_COMMENT.tag) { /*
                                                                         * do
@@ -63,12 +63,12 @@ public class TextFieldTest extends Speci
         // Debug.debug("field", Debug.getType(field));
 
         try {
-            Object textFieldValue = field.getValue();
+            final Object textFieldValue = field.getValue();
             // Debug.debug("imageFile", imageFile.getAbsoluteFile());
             // Debug.debug("Text field value(" + field.tagInfo.name + ")",
             // textFieldValue);
             // Debug.debug("userCommentValue", Debug.getType(userCommentValue));
-        } catch (ImageReadException e) {
+        } catch (final ImageReadException e) {
             Debug.debug("imageFile", imageFile.getAbsoluteFile());
             Debug.debug(e);
             throw e;

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/exif/WriteExifMetadataExampleTest.java Tue Dec  4 17:23:16 2012
@@ -33,26 +33,26 @@ public class WriteExifMetadataExampleTes
     // }
 
     public void test() throws Exception {
-        List<File> images = getJpegImages();
+        final List<File> images = getJpegImages();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile.getAbsoluteFile());
 
-            File tempFile = createTempFile("test", ".jpg");
+            final File tempFile = createTempFile("test", ".jpg");
             Debug.debug("tempFile", tempFile.getAbsoluteFile());
 
             try {
-                boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+                final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
                 if (ignoreImageData) {
                     continue;
                 }
                 new WriteExifMetadataExample().changeExifMetadata(imageFile,
                         tempFile);
-            } catch (ExifRewriter.ExifOverflowException e) {
+            } catch (final ExifRewriter.ExifOverflowException e) {
                 Debug.debug("Error image", imageFile.getAbsoluteFile());
                 Debug.debug(e, 4);
             }
@@ -60,26 +60,26 @@ public class WriteExifMetadataExampleTes
     }
 
     public void testInsert() throws Exception {
-        List<File> images = getJpegImages();
+        final List<File> images = getJpegImages();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile.getAbsoluteFile());
 
-            File tempFile = createTempFile("test", ".jpg");
+            final File tempFile = createTempFile("test", ".jpg");
             Debug.debug("tempFile", tempFile.getAbsoluteFile());
 
             try {
-                boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+                final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
                 if (ignoreImageData) {
                     continue;
                 }
                 new WriteExifMetadataExample().changeExifMetadata(imageFile,
                         tempFile);
-            } catch (ExifRewriter.ExifOverflowException e) {
+            } catch (final ExifRewriter.ExifOverflowException e) {
                 Debug.debug("Ignoring unavoidable ExifOverflowException",
                         e.getMessage());
                 Debug.debug("Error image", imageFile.getAbsoluteFile());

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBaseTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBaseTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBaseTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBaseTest.java Tue Dec  4 17:23:16 2012
@@ -28,7 +28,7 @@ import org.apache.commons.imaging.common
 import org.apache.commons.imaging.formats.jpeg.JpegImageParser;
 
 public abstract class IptcBaseTest extends ImagingTest {
-    protected static boolean hasIptcData(File file) {
+    protected static boolean hasIptcData(final File file) {
         // Debug.debug("hasIptcData file", file.getAbsoluteFile());
 
         if (!file.getName().toLowerCase().endsWith(".jpg"))
@@ -40,9 +40,9 @@ public abstract class IptcBaseTest exten
         }
 
         try {
-            ByteSource byteSource = new ByteSourceFile(file);
+            final ByteSource byteSource = new ByteSourceFile(file);
             return new JpegImageParser().hasIptcSegment(byteSource);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             // Debug.debug("Error file", file.getAbsoluteFile());
             // Debug.debug(e, 4);
             return false;
@@ -50,13 +50,13 @@ public abstract class IptcBaseTest exten
     }
 
     private static final ImageFilter HAS_IPTC_IMAGE_FILTER = new ImageFilter() {
-        public boolean accept(File file) throws IOException, ImageReadException {
+        public boolean accept(final File file) throws IOException, ImageReadException {
             return hasIptcData(file);
         }
     };
 
     private static final ImageFilter JPEG_IMAGE_FILTER = new ImageFilter() {
-        public boolean accept(File file) throws IOException, ImageReadException {
+        public boolean accept(final File file) throws IOException, ImageReadException {
             return file.getName().toLowerCase().endsWith(".jpg");
         }
     };
@@ -71,7 +71,7 @@ public abstract class IptcBaseTest exten
         return getTestImages(HAS_IPTC_IMAGE_FILTER);
     }
 
-    protected List<File> getImagesWithIptcData(int max) throws IOException,
+    protected List<File> getImagesWithIptcData(final int max) throws IOException,
             ImageReadException {
         return getTestImages(HAS_IPTC_IMAGE_FILTER, max);
     }
@@ -84,7 +84,7 @@ public abstract class IptcBaseTest exten
         return getTestImages(JPEG_IMAGE_FILTER);
     }
 
-    protected List<File> getJpegImages(int max) throws IOException,
+    protected List<File> getJpegImages(final int max) throws IOException,
             ImageReadException {
         return getTestImages(JPEG_IMAGE_FILTER, max);
     }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcDumpTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcDumpTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcDumpTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcDumpTest.java Tue Dec  4 17:23:16 2012
@@ -31,13 +31,13 @@ import org.apache.commons.imaging.util.D
 public class IptcDumpTest extends IptcBaseTest {
 
     public void test() throws Exception {
-        List<File> images = getImagesWithIptcData();
+        final List<File> images = getImagesWithIptcData();
         for (int i = 0; i < images.size(); i++) {
             if (i % 10 == 0) {
                 Debug.purgeMemory();
             }
 
-            File imageFile = images.get(i);
+            final File imageFile = images.get(i);
             Debug.debug("imageFile", imageFile);
             Debug.debug();
 
@@ -45,12 +45,12 @@ public class IptcDumpTest extends IptcBa
             // Debug.debug("Segments:");
             // new JpegUtils().dumpJFIF(byteSource);
 
-            Map<String,Object> params = new HashMap<String,Object>();
-            boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
+            final Map<String,Object> params = new HashMap<String,Object>();
+            final boolean ignoreImageData = isPhilHarveyTestImage(imageFile);
             params.put(PARAM_KEY_READ_THUMBNAILS, new Boolean(!ignoreImageData));
             // params.put(PARAM_KEY_VERBOSE, Boolean.TRUE);
 
-            JpegImageMetadata metadata = (JpegImageMetadata) Imaging
+            final JpegImageMetadata metadata = (JpegImageMetadata) Imaging
                     .getMetadata(imageFile, params);
             assertNotNull(metadata);
             assertNotNull(metadata.getPhotoshop());
@@ -60,12 +60,12 @@ public class IptcDumpTest extends IptcBa
             // Debug.debug("iptc size",
             // metadata.getPhotoshop().getItems().size());
 
-            JpegPhotoshopMetadata psMetadata = metadata.getPhotoshop();
-            List<IptcRecord> oldRecords = psMetadata.photoshopApp13Data.getRecords();
+            final JpegPhotoshopMetadata psMetadata = metadata.getPhotoshop();
+            final List<IptcRecord> oldRecords = psMetadata.photoshopApp13Data.getRecords();
 
             Debug.debug();
             for (int j = 0; j < oldRecords.size(); j++) {
-                IptcRecord record = oldRecords.get(j);
+                final IptcRecord record = oldRecords.get(j);
                 if (record.iptcType != IptcTypes.CITY) {
                     Debug.debug("Key: " + record.iptcType.getName() + " (0x"
                             + Integer.toHexString(record.iptcType.getType())



Mime
View raw message