commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1417043 [17/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/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorSpaceSubset.java Tue Dec  4 17:23:16 2012
@@ -26,7 +26,7 @@ class ColorSpaceSubset {
     public final int total;
     public int rgb; // median
 
-    public ColorSpaceSubset(int total, int precision) {
+    public ColorSpaceSubset(final int total, final int precision) {
         this.total = total;
         this.precision = precision;
         precision_mask = (1 << precision) - 1;
@@ -41,8 +41,8 @@ class ColorSpaceSubset {
         rgb = -1;
     }
 
-    public ColorSpaceSubset(int total, int precision, int mins[], int maxs[],
-            int table[]) {
+    public ColorSpaceSubset(final int total, final int precision, final int mins[], final int maxs[],
+            final int table[]) {
         this.total = total;
         this.precision = precision;
         this.mins = mins;
@@ -80,11 +80,11 @@ class ColorSpaceSubset {
         return true;
     }
 
-    public void dump(String prefix) {
-        int rdiff = maxs[0] - mins[0] + 1;
-        int gdiff = maxs[1] - mins[1] + 1;
-        int bdiff = maxs[2] - mins[2] + 1;
-        int color_area = rdiff * gdiff * bdiff;
+    public void dump(final String prefix) {
+        final int rdiff = maxs[0] - mins[0] + 1;
+        final int gdiff = maxs[1] - mins[1] + 1;
+        final int bdiff = maxs[2] - mins[2] + 1;
+        final int color_area = rdiff * gdiff * bdiff;
 
         System.out.println(prefix + ": [" + Integer.toHexString(rgb)
                 + "] total : " + total
@@ -108,7 +108,7 @@ class ColorSpaceSubset {
                         + color_area);
     }
 
-    public void dumpJustRGB(String prefix) {
+    public void dumpJustRGB(final String prefix) {
         System.out.println("\t" + "rgb: " + Integer.toHexString(rgb) + ", "
                 + "red: " + Integer.toHexString(mins[0] << (8 - precision))
                 + ", " + Integer.toHexString(maxs[0] << (8 - precision)) + ", "
@@ -119,26 +119,26 @@ class ColorSpaceSubset {
     }
 
     public int getArea() {
-        int rdiff = maxs[0] - mins[0] + 1;
-        int gdiff = maxs[1] - mins[1] + 1;
-        int bdiff = maxs[2] - mins[2] + 1;
-        int color_area = rdiff * gdiff * bdiff;
+        final int rdiff = maxs[0] - mins[0] + 1;
+        final int gdiff = maxs[1] - mins[1] + 1;
+        final int bdiff = maxs[2] - mins[2] + 1;
+        final int color_area = rdiff * gdiff * bdiff;
 
         return color_area;
 
     }
 
-    public void setAverageRGB(int table[]) {
+    public void setAverageRGB(final int table[]) {
         long redsum = 0, greensum = 0, bluesum = 0;
 
         for (int red = mins[0]; red <= maxs[0]; red++) {
             for (int green = mins[1]; green <= maxs[1]; green++) {
                 for (int blue = mins[2]; blue <= maxs[2]; blue++) {
                     // note: order reversed
-                    int index = (blue << (2 * precision)) 
+                    final int index = (blue << (2 * precision)) 
                             | (green << (1 * precision))
                             | (red << (0 * precision));
-                    int count = table[index];
+                    final int count = table[index];
                     redsum += count * (red << (8 - precision));
                     greensum += count * (green << (8 - precision));
                     bluesum += count * (blue << (8 - precision));
@@ -159,14 +159,14 @@ class ColorSpaceSubset {
         return index;
     }
 
-    public final void setIndex(int i) {
+    public final void setIndex(final int i) {
         index = i;
     }
 
     public static class RgbComparator implements Comparator<ColorSpaceSubset>, Serializable {
         private static final long serialVersionUID = 509214838111679029L;
 
-        public int compare(ColorSpaceSubset c1, ColorSpaceSubset c2) {
+        public int compare(final ColorSpaceSubset c1, final ColorSpaceSubset c2) {
             return c1.rgb - c2.rgb;
         }
     }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutQuantizer.java Tue Dec  4 17:23:16 2012
@@ -30,7 +30,7 @@ import org.apache.commons.imaging.util.D
 public class MedianCutQuantizer {
     private final boolean ignoreAlpha;
 
-    public MedianCutQuantizer(boolean ignore_alpha) {
+    public MedianCutQuantizer(final boolean ignore_alpha) {
         this.ignoreAlpha = ignore_alpha;
     }
 
@@ -39,7 +39,7 @@ public class MedianCutQuantizer {
         public int count = 0;
         public final int alpha, red, green, blue;
 
-        public ColorCount(int argb) {
+        public ColorCount(final int argb) {
             this.argb = argb;
 
             alpha = 0xff & (argb >> 24);
@@ -56,9 +56,9 @@ public class MedianCutQuantizer {
         }
 
         @Override
-        public boolean equals(Object o) {
+        public boolean equals(final Object o) {
             if (o instanceof ColorCount) {
-                ColorCount other = (ColorCount) o;
+                final ColorCount other = (ColorCount) o;
                 return other.argb == this.argb;
             }
             return false;
@@ -99,7 +99,7 @@ public class MedianCutQuantizer {
             }
 
             for (int i = 0; i < color_counts.size(); i++) {
-                ColorCount color = color_counts.get(i);
+                final ColorCount color = color_counts.get(i);
 
                 min_alpha = Math.min(min_alpha, color.alpha);
                 max_alpha = Math.max(max_alpha, color.alpha);
@@ -123,11 +123,11 @@ public class MedianCutQuantizer {
 
         }
 
-        public boolean contains(int argb) {
-            int alpha = 0xff & (argb >> 24);
-            int red = 0xff & (argb >> 16);
-            int green = 0xff & (argb >> 8);
-            int blue = 0xff & (argb >> 0);
+        public boolean contains(final int argb) {
+            final int alpha = 0xff & (argb >> 24);
+            final int red = 0xff & (argb >> 16);
+            final int green = 0xff & (argb >> 8);
+            final int blue = 0xff & (argb >> 0);
 
             if (!ignoreAlpha && (alpha < min_alpha || alpha > max_alpha)) {
                 return false;
@@ -149,7 +149,7 @@ public class MedianCutQuantizer {
             long alpha_total = 0, red_total = 0, green_total = 0, blue_total = 0;
 
             for (int i = 0; i < color_counts.size(); i++) {
-                ColorCount color = color_counts.get(i);
+                final ColorCount color = color_counts.get(i);
 
                 count_total += color.count;
                 alpha_total += color.count * color.alpha;
@@ -158,11 +158,11 @@ public class MedianCutQuantizer {
                 blue_total += color.count * color.blue;
             }
 
-            int alpha = ignoreAlpha ? 0xff : (int) Math
+            final int alpha = ignoreAlpha ? 0xff : (int) Math
                     .round((double) alpha_total / count_total);
-            int red = (int) Math.round((double) red_total / count_total);
-            int green = (int) Math.round((double) green_total / count_total);
-            int blue = (int) Math.round((double) blue_total / count_total);
+            final int red = (int) Math.round((double) red_total / count_total);
+            final int green = (int) Math.round((double) green_total / count_total);
+            final int blue = (int) Math.round((double) blue_total / count_total);
 
             return (alpha << 24) | (red << 16) | (green << 8) | blue;
         }
@@ -183,14 +183,14 @@ public class MedianCutQuantizer {
 
     }
 
-    public Map<Integer, ColorCount> groupColors1(BufferedImage image, int max,
-            int mask) {
-        Map<Integer, ColorCount> color_map = new HashMap<Integer, ColorCount>();
+    public Map<Integer, ColorCount> groupColors1(final BufferedImage image, final int max,
+            final int mask) {
+        final Map<Integer, ColorCount> color_map = new HashMap<Integer, ColorCount>();
 
-        int width = image.getWidth();
-        int height = image.getHeight();
+        final int width = image.getWidth();
+        final int height = image.getHeight();
 
-        int row[] = new int[width];
+        final int row[] = new int[width];
         for (int y = 0; y < height; y++) {
             image.getRGB(0, y, width, 1, row, 0, width);
             for (int x = 0; x < width; x++) {
@@ -216,9 +216,9 @@ public class MedianCutQuantizer {
         return color_map;
     }
 
-    public Map<Integer, ColorCount> groupColors(BufferedImage image,
-            int max_colors) {
-        int max = Integer.MAX_VALUE;
+    public Map<Integer, ColorCount> groupColors(final BufferedImage image,
+            final int max_colors) {
+        final int max = Integer.MAX_VALUE;
 
         for (int i = 0; i < 8; i++) {
             int mask = 0xff & (0xff << i);
@@ -227,7 +227,7 @@ public class MedianCutQuantizer {
             Debug.debug("mask(" + i + ")",
                     mask + " (" + Integer.toHexString(mask) + ")");
 
-            Map<Integer, ColorCount> result = groupColors1(image, max, mask);
+            final Map<Integer, ColorCount> result = groupColors1(image, max, mask);
             if (result != null) {
                 return result;
             }
@@ -235,22 +235,22 @@ public class MedianCutQuantizer {
         throw new Error("");
     }
 
-    public Palette process(BufferedImage image, int max_colors, boolean verbose)
+    public Palette process(final BufferedImage image, final int max_colors, final boolean verbose)
             throws ImageWriteException {
-        Map<Integer, ColorCount> color_map = groupColors(image, max_colors);
+        final Map<Integer, ColorCount> color_map = groupColors(image, max_colors);
 
-        int discrete_colors = color_map.keySet().size();
+        final int discrete_colors = color_map.keySet().size();
         if (discrete_colors <= max_colors) {
             if (verbose) {
                 Debug.debug("lossless palette: " + discrete_colors);
             }
 
-            int palette[] = new int[discrete_colors];
-            List<ColorCount> color_counts = new ArrayList<ColorCount>(
+            final int palette[] = new int[discrete_colors];
+            final List<ColorCount> color_counts = new ArrayList<ColorCount>(
                     color_map.values());
 
             for (int i = 0; i < color_counts.size(); i++) {
-                ColorCount color_count = color_counts.get(i);
+                final ColorCount color_count = color_counts.get(i);
                 palette[i] = color_count.argb;
                 if (ignoreAlpha) {
                     palette[i] |= 0xff000000;
@@ -264,13 +264,13 @@ public class MedianCutQuantizer {
             Debug.debug("discrete colors: " + discrete_colors);
         }
 
-        List<ColorGroup> color_groups = new ArrayList<ColorGroup>();
-        ColorGroup root = new ColorGroup(new ArrayList<ColorCount>(
+        final List<ColorGroup> color_groups = new ArrayList<ColorGroup>();
+        final ColorGroup root = new ColorGroup(new ArrayList<ColorCount>(
                 color_map.values()));
         color_groups.add(root);
 
         final Comparator<ColorGroup> comparator = new Comparator<ColorGroup>() {
-            public int compare(ColorGroup cg1, ColorGroup cg2) {
+            public int compare(final ColorGroup cg1, final ColorGroup cg2) {
                 if (cg1.max_diff == cg2.max_diff) {
                     return cg2.diff_total - cg1.diff_total;
                 }
@@ -281,7 +281,7 @@ public class MedianCutQuantizer {
         while (color_groups.size() < max_colors) {
             Collections.sort(color_groups, comparator);
 
-            ColorGroup color_group = color_groups.get(0);
+            final ColorGroup color_group = color_groups.get(0);
 
             if (color_group.max_diff == 0) {
                 break;
@@ -301,15 +301,15 @@ public class MedianCutQuantizer {
             }
         }
 
-        int palette_size = color_groups.size();
+        final int palette_size = color_groups.size();
         if (verbose) {
             Debug.debug("palette size: " + palette_size);
         }
 
-        int palette[] = new int[palette_size];
+        final int palette[] = new int[palette_size];
 
         for (int i = 0; i < color_groups.size(); i++) {
-            ColorGroup color_group = color_groups.get(i);
+            final ColorGroup color_group = color_groups.get(i);
 
             palette[i] = color_group.getMedianValue();
 
@@ -333,16 +333,16 @@ public class MedianCutQuantizer {
     private static final int GREEN = 2;
     private static final int BLUE = 3;
 
-    private void doCut(ColorGroup color_group, final int mode,
+    private void doCut(final ColorGroup color_group, final int mode,
             final List<ColorGroup> color_groups) throws ImageWriteException {
         int count_total = 0;
         for (int i = 0; i < color_group.color_counts.size(); i++) {
-            ColorCount color_count = color_group.color_counts.get(i);
+            final ColorCount color_count = color_group.color_counts.get(i);
             count_total += color_count.count;
         }
 
-        Comparator<ColorCount> comparator = new Comparator<ColorCount>() {
-            public int compare(ColorCount c1, ColorCount c2) {
+        final Comparator<ColorCount> comparator = new Comparator<ColorCount>() {
+            public int compare(final ColorCount c1, final ColorCount c2) {
                 switch (mode) {
                 case ALPHA:
                     return c1.alpha - c2.alpha;
@@ -359,11 +359,11 @@ public class MedianCutQuantizer {
         };
 
         Collections.sort(color_group.color_counts, comparator);
-        int count_half = (int) Math.round((double) count_total / 2);
+        final int count_half = (int) Math.round((double) count_total / 2);
         int old_count = 0, new_count = 0;
         int median_index;
         for (median_index = 0; median_index < color_group.color_counts.size(); median_index++) {
-            ColorCount color_count = color_group.color_counts.get(median_index);
+            final ColorCount color_count = color_group.color_counts.get(median_index);
 
             new_count += color_count.count;
 
@@ -377,17 +377,17 @@ public class MedianCutQuantizer {
         if (median_index == color_group.color_counts.size() - 1) {
             median_index--;
         } else if (median_index > 0) {
-            int new_diff = Math.abs(new_count - count_half);
-            int old_diff = Math.abs(count_half - old_count);
+            final int new_diff = Math.abs(new_count - count_half);
+            final int old_diff = Math.abs(count_half - old_count);
             if (old_diff < new_diff) {
                 median_index--;
             }
         }
 
         color_groups.remove(color_group);
-        List<ColorCount> color_counts1 = new ArrayList<ColorCount>(
+        final List<ColorCount> color_counts1 = new ArrayList<ColorCount>(
                 color_group.color_counts.subList(0, median_index + 1));
-        List<ColorCount> color_counts2 = new ArrayList<ColorCount>(
+        final List<ColorCount> color_counts2 = new ArrayList<ColorCount>(
                 color_group.color_counts.subList(median_index + 1,
                         color_group.color_counts.size()));
 
@@ -397,7 +397,7 @@ public class MedianCutQuantizer {
         more = new ColorGroup(new ArrayList<ColorCount>(color_counts2));
         color_groups.add(more);
 
-        ColorCount median_value = color_group.color_counts
+        final ColorCount median_value = color_group.color_counts
                 .get(median_index);
         int limit;
         switch (mode) {
@@ -423,15 +423,15 @@ public class MedianCutQuantizer {
         public final ColorGroup less, more;
         public final int mode, limit;
 
-        public ColorGroupCut(ColorGroup less, ColorGroup more, int mode,
-                int limit) {
+        public ColorGroupCut(final ColorGroup less, final ColorGroup more, final int mode,
+                final int limit) {
             this.less = less;
             this.more = more;
             this.mode = mode;
             this.limit = limit;
         }
 
-        public ColorGroup getColorGroup(int argb) {
+        public ColorGroup getColorGroup(final int argb) {
             int value;
             switch (mode) {
             case ALPHA:
@@ -460,13 +460,13 @@ public class MedianCutQuantizer {
     public static class MedianCutPalette extends SimplePalette {
         private final ColorGroup root;
 
-        public MedianCutPalette(ColorGroup root, int palette[]) {
+        public MedianCutPalette(final ColorGroup root, final int palette[]) {
             super(palette);
             this.root = root;
         }
 
         @Override
-        public int getPaletteIndex(int rgb) {
+        public int getPaletteIndex(final int rgb) {
             ColorGroup cg = root;
 
             while (cg.cut != null) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java Tue Dec  4 17:23:16 2012
@@ -41,27 +41,27 @@ public class PaletteFactory {
      * @param src the image whose palette to build
      * @return the palette
      */
-    public Palette makeExactRgbPaletteFancy(BufferedImage src) {
+    public Palette makeExactRgbPaletteFancy(final BufferedImage src) {
         // map what rgb values have been used
 
-        byte rgbmap[] = new byte[256 * 256 * 32];
+        final byte rgbmap[] = new byte[256 * 256 * 32];
 
-        int width = src.getWidth();
-        int height = src.getHeight();
+        final int width = src.getWidth();
+        final int height = src.getHeight();
 
         for (int y = 0; y < height; y++) {
             for (int x = 0; x < width; x++) {
-                int argb = src.getRGB(x, y);
-                int rggbb = 0x1fffff & argb;
-                int highred = 0x7 & (argb >> 21);
-                int mask = 1 << highred;
+                final int argb = src.getRGB(x, y);
+                final int rggbb = 0x1fffff & argb;
+                final int highred = 0x7 & (argb >> 21);
+                final int mask = 1 << highred;
                 rgbmap[rggbb] |= mask;
             }
         }
 
         int count = 0;
-        for (byte element : rgbmap) {
-            int eight = 0xff & element;
+        for (final byte element : rgbmap) {
+            final int eight = 0xff & element;
             count += Integer.bitCount(eight);
         }
 
@@ -69,17 +69,17 @@ public class PaletteFactory {
             System.out.println("Used colors: " + count);
         }
 
-        int colormap[] = new int[count];
+        final int colormap[] = new int[count];
         int mapsize = 0;
         for (int i = 0; i < rgbmap.length; i++) {
-            int eight = 0xff & rgbmap[i];
+            final int eight = 0xff & rgbmap[i];
             int mask = 0x80;
             for (int j = 0; j < 8; j++) {
-                int bit = eight & mask;
+                final int bit = eight & mask;
                 mask >>>= 1;
 
                 if (bit > 0) {
-                    int rgb = i | ((7 - j) << 21);
+                    final int rgb = i | ((7 - j) << 21);
 
                     colormap[mapsize++] = rgb;
                 }
@@ -90,9 +90,9 @@ public class PaletteFactory {
         return new SimplePalette(colormap);
     }
 
-    private int pixelToQuantizationTableIndex(int argb, int precision) {
+    private int pixelToQuantizationTableIndex(int argb, final int precision) {
         int result = 0;
-        int precision_mask = (1 << precision) - 1;
+        final int precision_mask = (1 << precision) - 1;
 
         for (int i = 0; i < components; i++) {
             int sample = argb & 0xff;
@@ -105,16 +105,16 @@ public class PaletteFactory {
         return result;
     }
 
-    private int getFrequencyTotal(int table[], int mins[], int maxs[],
-            int precision) {
+    private int getFrequencyTotal(final int table[], final int mins[], final int maxs[],
+            final int precision) {
         int sum = 0;
 
         for (int blue = mins[2]; blue <= maxs[2]; blue++) {
-            int b = (blue << (2 * precision));
+            final int b = (blue << (2 * precision));
             for (int green = mins[1]; green <= maxs[1]; green++) {
-                int g = (green << (1 * precision));
+                final int g = (green << (1 * precision));
                 for (int red = mins[0]; red <= maxs[0]; red++) {
-                    int index = b | g | red;
+                    final int index = b | g | red;
 
                     sum += table[index];
                 }
@@ -124,14 +124,14 @@ public class PaletteFactory {
         return sum;
     }
 
-    private DivisionCandidate finishDivision(int table[],
-            ColorSpaceSubset subset, int component, int precision, int sum,
-            int slice) {
+    private DivisionCandidate finishDivision(final int table[],
+            final ColorSpaceSubset subset, final int component, final int precision, final int sum,
+            final int slice) {
         if (debug) {
             subset.dump("trying (" + component + "): ");
         }
 
-        int total = subset.total;
+        final int total = subset.total;
 
         if ((slice < subset.mins[component])
                 || (slice >= subset.maxs[component])) {
@@ -142,14 +142,14 @@ public class PaletteFactory {
             return null;
         }
 
-        int remainder = total - sum;
+        final int remainder = total - sum;
         if ((remainder < 1) || (remainder >= total)) {
             return null;
         }
 
-        int slice_mins[] = new int[subset.mins.length];
+        final int slice_mins[] = new int[subset.mins.length];
         System.arraycopy(subset.mins, 0, slice_mins, 0, subset.mins.length);
-        int slice_maxs[] = new int[subset.maxs.length];
+        final int slice_maxs[] = new int[subset.maxs.length];
         System.arraycopy(subset.maxs, 0, slice_maxs, 0, subset.maxs.length);
 
         slice_maxs[component] = slice;
@@ -165,26 +165,26 @@ public class PaletteFactory {
 
         }
 
-        ColorSpaceSubset first = new ColorSpaceSubset(sum, precision,
+        final ColorSpaceSubset first = new ColorSpaceSubset(sum, precision,
                 subset.mins, slice_maxs, table);
-        ColorSpaceSubset second = new ColorSpaceSubset(total - sum, precision,
+        final ColorSpaceSubset second = new ColorSpaceSubset(total - sum, precision,
                 slice_mins, subset.maxs, table);
 
         return new DivisionCandidate(subset, first, second);
 
     }
 
-    private List<DivisionCandidate> divideSubset2(int table[],
-            ColorSpaceSubset subset, int component, int precision) {
+    private List<DivisionCandidate> divideSubset2(final int table[],
+            final ColorSpaceSubset subset, final int component, final int precision) {
         if (debug) {
             subset.dump("trying (" + component + "): ");
         }
 
-        int total = subset.total;
+        final int total = subset.total;
 
-        int slice_mins[] = new int[subset.mins.length];
+        final int slice_mins[] = new int[subset.mins.length];
         System.arraycopy(subset.mins, 0, slice_mins, 0, subset.mins.length);
-        int slice_maxs[] = new int[subset.maxs.length];
+        final int slice_maxs[] = new int[subset.maxs.length];
         System.arraycopy(subset.maxs, 0, slice_maxs, 0, subset.maxs.length);
 
         int sum1 = 0, sum2;
@@ -209,12 +209,12 @@ public class PaletteFactory {
         sum2 = sum1 - last;
         slice2 = slice1 - 1;
 
-        DivisionCandidate dc1 = finishDivision(table, subset, component,
+        final DivisionCandidate dc1 = finishDivision(table, subset, component,
                 precision, sum1, slice1);
-        DivisionCandidate dc2 = finishDivision(table, subset, component,
+        final DivisionCandidate dc2 = finishDivision(table, subset, component,
                 precision, sum2, slice2);
 
-        List<DivisionCandidate> result = new ArrayList<DivisionCandidate>();
+        final List<DivisionCandidate> result = new ArrayList<DivisionCandidate>();
 
         if (dc1 != null) {
             result.add(dc1);
@@ -226,9 +226,9 @@ public class PaletteFactory {
         return result;
     }
 
-    private DivisionCandidate divideSubset2(int table[],
-            ColorSpaceSubset subset, int precision) {
-        List<DivisionCandidate> dcs = new ArrayList<DivisionCandidate>();
+    private DivisionCandidate divideSubset2(final int table[],
+            final ColorSpaceSubset subset, final int precision) {
+        final List<DivisionCandidate> dcs = new ArrayList<DivisionCandidate>();
 
         dcs.addAll(divideSubset2(table, subset, 0, precision));
         dcs.addAll(divideSubset2(table, subset, 1, precision));
@@ -238,15 +238,15 @@ public class PaletteFactory {
         double best_score = Double.MAX_VALUE;
 
         for (int i = 0; i < dcs.size(); i++) {
-            DivisionCandidate dc = dcs.get(i);
+            final DivisionCandidate dc = dcs.get(i);
 
-            ColorSpaceSubset first = dc.dst_a;
-            ColorSpaceSubset second = dc.dst_b;
-            int area1 = first.total;
-            int area2 = second.total;
+            final ColorSpaceSubset first = dc.dst_a;
+            final ColorSpaceSubset second = dc.dst_b;
+            final int area1 = first.total;
+            final int area2 = second.total;
 
-            int diff = Math.abs(area1 - area2);
-            double score = ((double) diff) / ((double) Math.max(area1, area2));
+            final int diff = Math.abs(area1 - area2);
+            final double score = ((double) diff) / ((double) Math.max(area1, area2));
 
             if (best_v == null) {
                 best_v = dc;
@@ -267,17 +267,17 @@ public class PaletteFactory {
         // private final ColorSpaceSubset src;
         private final ColorSpaceSubset dst_a, dst_b;
 
-        public DivisionCandidate(ColorSpaceSubset src, ColorSpaceSubset dst_a,
-                ColorSpaceSubset dst_b) {
+        public DivisionCandidate(final ColorSpaceSubset src, final ColorSpaceSubset dst_a,
+                final ColorSpaceSubset dst_b) {
             // this.src = src;
             this.dst_a = dst_a;
             this.dst_b = dst_b;
         }
     }
 
-    private List<ColorSpaceSubset> divide(List<ColorSpaceSubset> v,
-            int desired_count, int table[], int precision) {
-        List<ColorSpaceSubset> ignore = new ArrayList<ColorSpaceSubset>();
+    private List<ColorSpaceSubset> divide(final List<ColorSpaceSubset> v,
+            final int desired_count, final int table[], final int precision) {
+        final List<ColorSpaceSubset> ignore = new ArrayList<ColorSpaceSubset>();
 
         int count = 0;
         while (true) {
@@ -292,11 +292,11 @@ public class PaletteFactory {
             ColorSpaceSubset max_subset = null;
 
             for (int i = 0; i < v.size(); i++) {
-                ColorSpaceSubset subset = v.get(i);
+                final ColorSpaceSubset subset = v.get(i);
                 if (ignore.contains(subset)) {
                     continue;
                 }
-                int area = subset.total;
+                final int area = subset.total;
 
                 if (max_subset == null) {
                     max_subset = subset;
@@ -314,7 +314,7 @@ public class PaletteFactory {
                 System.out.println("\t" + "area: " + max_area);
             }
 
-            DivisionCandidate dc = divideSubset2(table, max_subset,
+            final DivisionCandidate dc = divideSubset2(table, max_subset,
                     precision);
             if (dc != null) {
                 v.remove(max_subset);
@@ -339,38 +339,38 @@ public class PaletteFactory {
      * @param max the maximum number of colors the palette can contain
      * @return the palette of at most {@code max} colors
      */
-    public Palette makeQuantizedRgbPalette(BufferedImage src, int max) {
-        int precision = 6; // in bits
+    public Palette makeQuantizedRgbPalette(final BufferedImage src, final int max) {
+        final int precision = 6; // in bits
 
-        int table_scale = precision * components;
-        int table_size = 1 << table_scale;
-        int table[] = new int[table_size];
+        final int table_scale = precision * components;
+        final int table_size = 1 << table_scale;
+        final int table[] = new int[table_size];
 
-        int width = src.getWidth();
-        int height = src.getHeight();
+        final int width = src.getWidth();
+        final int height = src.getHeight();
 
         List<ColorSpaceSubset> subsets = new ArrayList<ColorSpaceSubset>();
-        ColorSpaceSubset all = new ColorSpaceSubset(width * height, precision);
+        final ColorSpaceSubset all = new ColorSpaceSubset(width * height, precision);
         subsets.add(all);
 
         if (debug) {
-            int pre_total = getFrequencyTotal(table, all.mins, all.maxs, precision);
+            final int pre_total = getFrequencyTotal(table, all.mins, all.maxs, precision);
             System.out.println("pre total: " + pre_total);
         }
 
         // step 1: count frequency of colors
         for (int y = 0; y < height; y++) {
             for (int x = 0; x < width; x++) {
-                int argb = src.getRGB(x, y);
+                final int argb = src.getRGB(x, y);
 
-                int index = pixelToQuantizationTableIndex(argb, precision);
+                final int index = pixelToQuantizationTableIndex(argb, precision);
 
                 table[index]++;
             }
         }
 
         if (debug) {
-            int all_total = getFrequencyTotal(table, all.mins, all.maxs, precision);
+            final int all_total = getFrequencyTotal(table, all.mins, all.maxs, precision);
             System.out.println("all total: " + all_total);
             System.out.println("width * height: " + (width * height));
         }
@@ -383,7 +383,7 @@ public class PaletteFactory {
         }
 
         for (int i = 0; i < subsets.size(); i++) {
-            ColorSpaceSubset subset = subsets.get(i);
+            final ColorSpaceSubset subset = subsets.get(i);
 
             subset.setAverageRGB(table);
 
@@ -407,7 +407,7 @@ public class PaletteFactory {
      * @param max the maximum number of colors the palette can contain
      * @return the palette of at most {@code max} colors
      */
-    public Palette makeQuantizedRgbaPalette(BufferedImage src, boolean transparent, int max) throws ImageWriteException {
+    public Palette makeQuantizedRgbaPalette(final BufferedImage src, final boolean transparent, final int max) throws ImageWriteException {
         return new MedianCutQuantizer(!transparent).process(src, max, false);
     }
 
@@ -418,17 +418,17 @@ public class PaletteFactory {
      * @param max the maximum number of colors the palette can contain
      * @return the complete palette of {@code max} or less colors, or {@code null} if more than {@code max} colors are necessary
      */
-    public SimplePalette makeExactRgbPaletteSimple(BufferedImage src, int max) {
+    public SimplePalette makeExactRgbPaletteSimple(final BufferedImage src, final int max) {
         // This is not efficient for large values of max, say, max > 256;
-        Set<Integer> rgbs = new HashSet<Integer>();
+        final Set<Integer> rgbs = new HashSet<Integer>();
 
-        int width = src.getWidth();
-        int height = src.getHeight();
+        final int width = src.getWidth();
+        final int height = src.getHeight();
 
         for (int y = 0; y < height; y++) {
             for (int x = 0; x < width; x++) {
-                int argb = src.getRGB(x, y);
-                int rgb = 0xffffff & argb;
+                final int argb = src.getRGB(x, y);
+                final int rgb = 0xffffff & argb;
 
                 if (rgbs.add(rgb) && rgbs.size() > max) {
                     return null;
@@ -436,9 +436,9 @@ public class PaletteFactory {
             }
         }
         
-        int result[] = new int[rgbs.size()];
+        final int result[] = new int[rgbs.size()];
         int next = 0;
-        for (int rgb : rgbs) {
+        for (final int rgb : rgbs) {
             result[next++] = rgb;
         }
         Arrays.sort(result);
@@ -446,9 +446,9 @@ public class PaletteFactory {
         return new SimplePalette(result);
     }
 
-    public boolean isGrayscale(BufferedImage src) {
-        int width = src.getWidth();
-        int height = src.getHeight();
+    public boolean isGrayscale(final BufferedImage src) {
+        final int width = src.getWidth();
+        final int height = src.getHeight();
 
         if (ColorSpace.TYPE_GRAY == src.getColorModel().getColorSpace()
                 .getType()) {
@@ -457,11 +457,11 @@ public class PaletteFactory {
 
         for (int y = 0; y < height; y++) {
             for (int x = 0; x < width; x++) {
-                int argb = src.getRGB(x, y);
+                final int argb = src.getRGB(x, y);
 
-                int red = 0xff & (argb >> 16);
-                int green = 0xff & (argb >> 8);
-                int blue = 0xff & (argb >> 0);
+                final int red = 0xff & (argb >> 16);
+                final int green = 0xff & (argb >> 8);
+                final int blue = 0xff & (argb >> 0);
 
                 if (red != green || red != blue) {
                     return false;
@@ -471,13 +471,13 @@ public class PaletteFactory {
         return true;
     }
 
-    public boolean hasTransparency(BufferedImage src) {
+    public boolean hasTransparency(final BufferedImage src) {
         return hasTransparency(src, 255);
     }
 
-    public boolean hasTransparency(BufferedImage src, int threshold) {
-        int width = src.getWidth();
-        int height = src.getHeight();
+    public boolean hasTransparency(final BufferedImage src, final int threshold) {
+        final int width = src.getWidth();
+        final int height = src.getHeight();
 
         if (!src.getColorModel().hasAlpha()) {
             return false;
@@ -485,8 +485,8 @@ public class PaletteFactory {
 
         for (int y = 0; y < height; y++) {
             for (int x = 0; x < width; x++) {
-                int argb = src.getRGB(x, y);
-                int alpha = 0xff & (argb >> 24);
+                final int argb = src.getRGB(x, y);
+                final int alpha = 0xff & (argb >> 24);
                 if (alpha < threshold) {
                     return true;
                 }
@@ -495,11 +495,11 @@ public class PaletteFactory {
         return false;
     }
 
-    public int countTrasparentColors(int rgbs[]) {
+    public int countTrasparentColors(final int rgbs[]) {
         int first = -1;
 
-        for (int rgb : rgbs) {
-            int alpha = 0xff & (rgb >> 24);
+        for (final int rgb : rgbs) {
+            final int alpha = 0xff & (rgb >> 24);
             if (alpha < 0xff) {
                 if (first < 0) {
                     first = rgb;
@@ -515,21 +515,21 @@ public class PaletteFactory {
         return 1;
     }
 
-    public int countTransparentColors(BufferedImage src) {
-        ColorModel cm = src.getColorModel();
+    public int countTransparentColors(final BufferedImage src) {
+        final ColorModel cm = src.getColorModel();
         if (!cm.hasAlpha()) {
             return 0;
         }
 
-        int width = src.getWidth();
-        int height = src.getHeight();
+        final int width = src.getWidth();
+        final int height = src.getHeight();
 
         int first = -1;
 
         for (int y = 0; y < height; y++) {
             for (int x = 0; x < width; x++) {
-                int rgb = src.getRGB(x, y);
-                int alpha = 0xff & (rgb >> 24);
+                final int rgb = src.getRGB(x, y);
+                final int alpha = 0xff & (rgb >> 24);
                 if (alpha < 0xff) {
                     if (first < 0) {
                         first = rgb;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/QuantizedPalette.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/QuantizedPalette.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/QuantizedPalette.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/QuantizedPalette.java Tue Dec  4 17:23:16 2012
@@ -25,20 +25,20 @@ public class QuantizedPalette extends Pa
     private final List<ColorSpaceSubset> subsets;
     private final ColorSpaceSubset straight[];
 
-    public QuantizedPalette(List<ColorSpaceSubset> subsets, int precision) {
+    public QuantizedPalette(final List<ColorSpaceSubset> subsets, final int precision) {
         this.subsets = subsets;
         this.precision = precision;
 
         straight = new ColorSpaceSubset[1 << (precision * 3)];
 
         for (int i = 0; i < subsets.size(); i++) {
-            ColorSpaceSubset subset = subsets.get(i);
+            final ColorSpaceSubset subset = subsets.get(i);
             subset.setIndex(i);
 
             for (int u = subset.mins[0]; u <= subset.maxs[0]; u++) {
                 for (int j = subset.mins[1]; j <= subset.maxs[1]; j++) {
                     for (int k = subset.mins[2]; k <= subset.maxs[2]; k++) {
-                        int index = (u << (precision * 2))
+                        final int index = (u << (precision * 2))
                                 | (j << (precision * 1))
                                 | (k << (precision * 0));
                         straight[index] = subset;
@@ -49,10 +49,10 @@ public class QuantizedPalette extends Pa
     }
 
     @Override
-    public int getPaletteIndex(int rgb) throws ImageWriteException {
-        int precisionMask = (1 << precision) - 1;
+    public int getPaletteIndex(final int rgb) throws ImageWriteException {
+        final int precisionMask = (1 << precision) - 1;
 
-        int index = ((rgb >> (24 - 3 * precision)) & (precisionMask << (precision << 1)))
+        final int index = ((rgb >> (24 - 3 * precision)) & (precisionMask << (precision << 1)))
                 | ((rgb >> (16 - 2 * precision)) & (precisionMask << precision))
                 | ((rgb >> (8 - precision)) & (precisionMask));
 
@@ -68,8 +68,8 @@ public class QuantizedPalette extends Pa
     }
 
     @Override
-    public int getEntry(int index) {
-        ColorSpaceSubset subset = subsets.get(index);
+    public int getEntry(final int index) {
+        final ColorSpaceSubset subset = subsets.get(index);
         return subset.rgb;
     }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java Tue Dec  4 17:23:16 2012
@@ -21,21 +21,21 @@ import org.apache.commons.imaging.util.D
 public class SimplePalette extends Palette {
     private final int palette[];
 
-    public SimplePalette(int palette[]) {
+    public SimplePalette(final int palette[]) {
         this.palette = palette;
     }
 
     @Override
-    public int getPaletteIndex(int rgb) {
+    public int getPaletteIndex(final int rgb) {
         return getPaletteIndex(palette, rgb);
     }
 
     @Override
-    public int getEntry(int index) {
+    public int getEntry(final int index) {
         return palette[index];
     }
 
-    private int getPaletteIndex(int palette[], int argb) {
+    private int getPaletteIndex(final int palette[], final int argb) {
         for (int i = 0; i < palette.length; i++) {
             if (palette[i] == argb) {
                 return i;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingInputStream.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingInputStream.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingInputStream.java Tue Dec  4 17:23:16 2012
@@ -25,7 +25,7 @@ public class CachingInputStream extends 
     private final InputStream is;
     private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-    public CachingInputStream(InputStream is) {
+    public CachingInputStream(final InputStream is) {
         this.is = is;
     }
 
@@ -35,7 +35,7 @@ public class CachingInputStream extends 
 
     @Override
     public int read() throws IOException {
-        int result = is.read();
+        final int result = is.read();
         baos.write(result);
         return result;
     }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingOutputStream.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingOutputStream.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/CachingOutputStream.java Tue Dec  4 17:23:16 2012
@@ -25,12 +25,12 @@ public class CachingOutputStream extends
     private final OutputStream os;
     private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-    public CachingOutputStream(OutputStream os) {
+    public CachingOutputStream(final OutputStream os) {
         this.os = os;
     }
 
     @Override
-    public void write(int b) throws IOException {
+    public void write(final int b) throws IOException {
         os.write(b);
         baos.write(b);
     }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java Tue Dec  4 17:23:16 2012
@@ -33,19 +33,19 @@ public final class Debug {
 
     private static final boolean DEBUG = false;
 
-    public static void debug(String message) {
+    public static void debug(final String message) {
         if (DEBUG) {
             System.out.println(message);
         }
     }
 
-    public static void debug(Object o) {
+    public static void debug(final Object o) {
         if (DEBUG) {
             System.out.println(o == null ? "null" : o.toString());
         }
     }
 
-    public static String getDebug(String message) {
+    public static String getDebug(final String message) {
         return message;
     }
 
@@ -59,30 +59,30 @@ public final class Debug {
         }
     }
 
-    public static String getDebug(String message, int value) {
+    public static String getDebug(final String message, final int value) {
         return getDebug(message + ": " + (value));
     }
 
-    public static String getDebug(String message, double value) {
+    public static String getDebug(final String message, final double value) {
         return getDebug(message + ": " + (value));
     }
 
-    public static String getDebug(String message, String value) {
+    public static String getDebug(final String message, final String value) {
         return getDebug(message + " " + value);
     }
 
-    public static String getDebug(String message, long value) {
+    public static String getDebug(final String message, final long value) {
         return getDebug(message + " " + Long.toString(value));
     }
 
-    public static String getDebug(String message, int v[]) {
-        StringBuilder result = new StringBuilder();
+    public static String getDebug(final String message, final int v[]) {
+        final StringBuilder result = new StringBuilder();
 
         if (v == null) {
             result.append(message + " (" + null + ")" + newline);
         } else {
             result.append(message + " (" + v.length + ")" + newline);
-            for (int element : v) {
+            for (final int element : v) {
                 result.append("\t" + element + newline);
             }
             result.append(newline);
@@ -90,21 +90,21 @@ public final class Debug {
         return result.toString();
     }
 
-    public static String getDebug(String message, byte v[]) {
+    public static String getDebug(final String message, final byte v[]) {
         final int max = 250;
         return getDebug(message, v, max);
     }
 
-    public static String getDebug(String message, byte v[], int max) {
+    public static String getDebug(final String message, final byte v[], final int max) {
 
-        StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder();
 
         if (v == null) {
             result.append(message + " (" + null + ")" + newline);
         } else {
             result.append(message + " (" + v.length + ")" + newline);
             for (int i = 0; i < max && i < v.length; i++) {
-                int b = 0xff & v[i];
+                final int b = 0xff & v[i];
 
                 char c;
                 if (b == 0 || b == 10 || b == 11 || b == 13) {
@@ -125,14 +125,14 @@ public final class Debug {
         return result.toString();
     }
 
-    public static String getDebug(String message, char v[]) {
-        StringBuilder result = new StringBuilder();
+    public static String getDebug(final String message, final char v[]) {
+        final StringBuilder result = new StringBuilder();
 
         if (v == null) {
             result.append(getDebug(message + " (" + null + ")") + newline);
         } else {
             result.append(getDebug(message + " (" + v.length + ")") + newline);
-            for (char element : v) {
+            for (final char element : v) {
                 result.append(getDebug("\t" + element + " (" + (0xff & element))
                         + ")" + newline);
             }
@@ -143,10 +143,10 @@ public final class Debug {
 
     private static long counter = 0;
 
-    public static String getDebug(String message, java.util.List<?> v) {
-        StringBuilder result = new StringBuilder();
+    public static String getDebug(final String message, final java.util.List<?> v) {
+        final StringBuilder result = new StringBuilder();
 
-        String suffix = " [" + counter++ + "]";
+        final String suffix = " [" + counter++ + "]";
 
         result.append(getDebug(message + " (" + v.size() + ")" + suffix)
                 + newline);
@@ -159,22 +159,22 @@ public final class Debug {
         return result.toString();
     }
 
-    public static void debug(String message, Map<?, ?> map) {
+    public static void debug(final String message, final Map<?, ?> map) {
         debug(getDebug(message, map));
     }
 
-    public static String getDebug(String message, Map<?,?> map) {
-        StringBuilder result = new StringBuilder();
+    public static String getDebug(final String message, final Map<?,?> map) {
+        final StringBuilder result = new StringBuilder();
 
         if (map == null) {
             return getDebug(message + " map: " + null);
         }
 
-        List<Object> keys = new ArrayList<Object>(map.keySet());
+        final List<Object> keys = new ArrayList<Object>(map.keySet());
         result.append(getDebug(message + " map: " + keys.size()) + newline);
         for (int i = 0; i < keys.size(); i++) {
-            Object key = keys.get(i);
-            Object value = map.get(key);
+            final Object key = keys.get(i);
+            final Object value = map.get(key);
             result.append(getDebug("\t" + i + ": '" + key + "' -> '" + value
                     + "'")
                     + newline);
@@ -185,22 +185,22 @@ public final class Debug {
         return result.toString();
     }
 
-    public static boolean compare(String prefix, Map<?, ?> a, Map<?, ?> b) {
+    public static boolean compare(final String prefix, final Map<?, ?> a, final Map<?, ?> b) {
         return compare(prefix, a, b, null, null);
     }
 
     // public static String newline = System.getProperty("line.separator");
     public static final String newline = "\r\n";
 
-    private static void log(StringBuilder buffer, String s) {
+    private static void log(final StringBuilder buffer, final String s) {
         Debug.debug(s);
         if (buffer != null) {
             buffer.append(s + newline);
         }
     }
 
-    public static boolean compare(String prefix, Map<?, ?> a, Map<?, ?> b, List<?> ignore,
-            StringBuilder buffer) {
+    public static boolean compare(final String prefix, final Map<?, ?> a, final Map<?, ?> b, final List<?> ignore,
+            final StringBuilder buffer) {
         if ((a == null) && (b == null)) {
             log(buffer, prefix + " both maps null");
             return true;
@@ -214,8 +214,8 @@ public final class Debug {
             return false;
         }
 
-        List<?> keys_a = new ArrayList<Object>(a.keySet());
-        List<?> keys_b = new ArrayList<Object>(b.keySet());
+        final List<?> keys_a = new ArrayList<Object>(a.keySet());
+        final List<?> keys_b = new ArrayList<Object>(b.keySet());
 
         if (ignore != null) {
             keys_a.removeAll(ignore);
@@ -225,14 +225,14 @@ public final class Debug {
         boolean result = true;
 
         for (int i = 0; i < keys_a.size(); i++) {
-            Object key = keys_a.get(i);
+            final Object key = keys_a.get(i);
             if (!keys_b.contains(key)) {
                 log(buffer, prefix + "b is missing key '" + key + "' from a");
                 result = false;
             } else {
                 keys_b.remove(key);
-                Object value_a = a.get(key);
-                Object value_b = b.get(key);
+                final Object value_a = a.get(key);
+                final Object value_b = b.get(key);
                 if (!value_a.equals(value_b)) {
                     log(buffer, prefix + "key(" + key + ") value a: " + value_a
                             + ") !=  b: " + value_b + ")");
@@ -241,7 +241,7 @@ public final class Debug {
             }
         }
         for (int i = 0; i < keys_b.size(); i++) {
-            Object key = keys_b.get(i);
+            final Object key = keys_b.get(i);
 
             log(buffer, prefix + "a is missing key '" + key + "' from b");
             result = false;
@@ -254,18 +254,18 @@ public final class Debug {
         return result;
     }
 
-    private static String byteQuadToString(int bytequad) {
-        byte b1 = (byte) ((bytequad >> 24) & 0xff);
-        byte b2 = (byte) ((bytequad >> 16) & 0xff);
-        byte b3 = (byte) ((bytequad >> 8) & 0xff);
-        byte b4 = (byte) ((bytequad >> 0) & 0xff);
-
-        char c1 = (char) b1;
-        char c2 = (char) b2;
-        char c3 = (char) b3;
-        char c4 = (char) b4;
+    private static String byteQuadToString(final int bytequad) {
+        final byte b1 = (byte) ((bytequad >> 24) & 0xff);
+        final byte b2 = (byte) ((bytequad >> 16) & 0xff);
+        final byte b3 = (byte) ((bytequad >> 8) & 0xff);
+        final byte b4 = (byte) ((bytequad >> 0) & 0xff);
+
+        final char c1 = (char) b1;
+        final char c2 = (char) b2;
+        final char c3 = (char) b3;
+        final char c4 = (char) b4;
         // return new String(new char[] { c1, c2, c3, c4 });
-        StringBuilder fStringBuffer = new StringBuilder();
+        final StringBuilder fStringBuffer = new StringBuilder();
         fStringBuffer.append(new String(new char[] { c1, c2, c3, c4 }));
         fStringBuffer.append(" bytequad: " + bytequad);
         fStringBuffer.append(" b1: " + b1);
@@ -276,9 +276,9 @@ public final class Debug {
         return fStringBuffer.toString();
     }
 
-    public static String getDebug(String message, ICC_Profile value) {
+    public static String getDebug(final String message, final ICC_Profile value) {
 
-        StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder();
 
         result.append(getDebug("ICC_Profile " + message + ": "
                 + ((value == null) ? "null" : value.toString()))
@@ -299,27 +299,27 @@ public final class Debug {
 
     }
 
-    public static String getDebug(String message, boolean value) {
+    public static String getDebug(final String message, final boolean value) {
         return getDebug(message + " " + ((value) ? ("true") : ("false")));
     }
 
-    public static String getDebug(String message, File file) {
+    public static String getDebug(final String message, final File file) {
         return getDebug(message + ": "
                 + ((file == null) ? "null" : file.getPath()));
     }
 
-    public static String getDebug(String message, Date value) {
-        DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
+    public static String getDebug(final String message, final Date value) {
+        final DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
         return getDebug(message, (value == null) ? "null" : df.format(value));
     }
 
-    public static String getDebug(String message, Calendar value) {
-        DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
+    public static String getDebug(final String message, final Calendar value) {
+        final DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
         return getDebug(message,
                 (value == null) ? "null" : df.format(value.getTime()));
     }
 
-    public static void debug(String message, Object value) {
+    public static void debug(final String message, final Object value) {
         if (value == null) {
             debug(message, "null");
         } else if (value instanceof char[]) {
@@ -349,7 +349,7 @@ public final class Debug {
         }
     }
 
-    public static void debug(String message, Object value[]) {
+    public static void debug(final String message, final Object value[]) {
         if (value == null) {
             debug(message, "null");
         } else {
@@ -365,7 +365,7 @@ public final class Debug {
         debug();
     }
 
-    public static String getDebug(String message, Object value) {
+    public static String getDebug(final String message, final Object value) {
         if (value == null) {
             return getDebug(message, "null");
         } else if (value instanceof Calendar) {
@@ -397,7 +397,7 @@ public final class Debug {
         }
     }
 
-    public static String getType(Object value) {
+    public static String getType(final Object value) {
         if (value == null) {
             return "null";
         } else if (value instanceof Object[]) {
@@ -423,7 +423,7 @@ public final class Debug {
         }
     }
 
-    public static boolean isArray(Object value) {
+    public static boolean isArray(final Object value) {
         if (value == null) {
             return false;
         } else if (value instanceof Object[]) {
@@ -449,8 +449,8 @@ public final class Debug {
         }
     }
 
-    public static String getDebug(String message, Object value[]) {
-        StringBuilder result = new StringBuilder();
+    public static String getDebug(final String message, final Object value[]) {
+        final StringBuilder result = new StringBuilder();
 
         if (value == null) {
             result.append(getDebug(message, "null") + newline);
@@ -469,41 +469,41 @@ public final class Debug {
         return result.toString();
     }
 
-    public static String getDebug(Class<?> fClass, Throwable e) {
+    public static String getDebug(final Class<?> fClass, final Throwable e) {
         return getDebug(fClass == null ? "[Unknown]" : fClass.getName(), e);
     }
 
-    public static void debug(Class<?> fClass, Throwable e) {
+    public static void debug(final Class<?> fClass, final Throwable e) {
         debug(fClass.getName(), e);
     }
 
-    public static void debug(String message, boolean value) {
+    public static void debug(final String message, final boolean value) {
         debug(message + " " + ((value) ? ("true") : ("false")));
     }
 
-    public static void debug(String message, byte v[]) {
+    public static void debug(final String message, final byte v[]) {
         debug(getDebug(message, v));
     }
 
-    public static void debug(String message, char v[]) {
+    public static void debug(final String message, final char v[]) {
         debug(getDebug(message, v));
     }
 
-    public static void debug(String message, Calendar value) {
-        DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
+    public static void debug(final String message, final Calendar value) {
+        final DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
         debug(message, (value == null) ? "null" : df.format(value.getTime()));
     }
 
-    public static void debug(String message, Date value) {
-        DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
+    public static void debug(final String message, final Date value) {
+        final DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
         debug(message, (value == null) ? "null" : df.format(value));
     }
 
-    public static void debug(String message, double value) {
+    public static void debug(final String message, final double value) {
         debug(message + ": " + (value));
     }
 
-    public static void debug(String message, File file) {
+    public static void debug(final String message, final File file) {
         debug(message + ": " + ((file == null) ? "null" : file.getPath()));
     }
 
@@ -513,7 +513,7 @@ public final class Debug {
     // + ((value == null) ? "null" : value.toString()));
     // }
 
-    public static void debug(String message, ICC_Profile value) {
+    public static void debug(final String message, final ICC_Profile value) {
         debug("ICC_Profile " + message + ": "
                 + ((value == null) ? "null" : value.toString()));
         if (value != null) {
@@ -525,20 +525,20 @@ public final class Debug {
         }
     }
 
-    public static void debug(String message, int value) {
+    public static void debug(final String message, final int value) {
         debug(message + ": " + (value));
     }
 
-    public static void debug(String message, int v[]) {
+    public static void debug(final String message, final int v[]) {
         debug(getDebug(message, v));
     }
 
-    public static void debug(String message, byte v[], int max) {
+    public static void debug(final String message, final byte v[], final int max) {
         debug(getDebug(message, v, max));
     }
 
-    public static void debug(String message, java.util.List<?> v) {
-        String suffix = " [" + counter++ + "]";
+    public static void debug(final String message, final java.util.List<?> v) {
+        final String suffix = " [" + counter++ + "]";
 
         debug(message + " (" + v.size() + ")" + suffix);
         for (int i = 0; i < v.size(); i++) {
@@ -547,32 +547,32 @@ public final class Debug {
         debug();
     }
 
-    public static void debug(String message, long value) {
+    public static void debug(final String message, final long value) {
         debug(message + " " + Long.toString(value));
     }
 
-    public static void debug(String prefix, Point p) {
+    public static void debug(final String prefix, final Point p) {
         System.out.println(prefix + ": "
                 + ((p == null) ? "null" : (p.x + ", " + p.y)));
     }
 
-    public static void debug(String prefix, Rectangle r) {
+    public static void debug(final String prefix, final Rectangle r) {
         debug(getDebug(prefix, r));
     }
 
-    public static void debug(String message, String value) {
+    public static void debug(final String message, final String value) {
         debug(message + " " + value);
     }
 
-    public static void debug(String message, Throwable e) {
+    public static void debug(final String message, final Throwable e) {
         debug(getDebug(message, e));
     }
 
-    public static void debug(Throwable e) {
+    public static void debug(final Throwable e) {
         debug(getDebug(e));
     }
 
-    public static void debug(Throwable e, int value) {
+    public static void debug(final Throwable e, final int value) {
         debug(getDebug(e, value));
     }
 
@@ -580,24 +580,24 @@ public final class Debug {
         debug(getStackTrace(new Exception("Stack trace"), -1, 1));
     }
 
-    public static void dumpStack(int limit) {
+    public static void dumpStack(final int limit) {
         debug(getStackTrace(new Exception("Stack trace"), limit, 1));
     }
 
-    public static String getDebug(String message, Throwable e) {
+    public static String getDebug(final String message, final Throwable e) {
         return message + newline + getDebug(e);
     }
 
-    public static String getDebug(Throwable e) {
+    public static String getDebug(final Throwable e) {
         return getDebug(e, -1);
     }
 
-    public static String getDebug(Throwable e, int max) {
-        StringBuilder result = new StringBuilder();
+    public static String getDebug(final Throwable e, final int max) {
+        final StringBuilder result = new StringBuilder();
 
         final SimpleDateFormat timestamp = new SimpleDateFormat(
                 "yyyy-MM-dd kk:mm:ss:SSS");
-        String datetime = timestamp.format(new Date()).toLowerCase();
+        final String datetime = timestamp.format(new Date()).toLowerCase();
 
         result.append(newline);
         result.append("Throwable: "
@@ -616,22 +616,22 @@ public final class Debug {
         return result.toString();
     }
 
-    public static String getStackTrace(Throwable e) {
+    public static String getStackTrace(final Throwable e) {
         return getStackTrace(e, -1);
     }
 
-    public static String getStackTrace(Throwable e, int limit) {
+    public static String getStackTrace(final Throwable e, final int limit) {
         return getStackTrace(e, limit, 0);
     }
 
-    public static String getStackTrace(Throwable e, int limit, int skip) {
-        StringBuilder result = new StringBuilder();
+    public static String getStackTrace(final Throwable e, final int limit, final int skip) {
+        final StringBuilder result = new StringBuilder();
 
         if (e != null) {
-            StackTraceElement stes[] = e.getStackTrace();
+            final StackTraceElement stes[] = e.getStackTrace();
             if (stes != null) {
                 for (int i = skip; i < stes.length && (limit < 0 || i < limit); i++) {
-                    StackTraceElement ste = stes[i];
+                    final StackTraceElement ste = stes[i];
 
                     result.append("\tat " + ste.getClassName() + "."
                             + ste.getMethodName() + "(" + ste.getFileName()
@@ -649,27 +649,27 @@ public final class Debug {
         return result.toString();
     }
 
-    public static void debugByteQuad(String message, int i) {
-        int alpha = (i >> 24) & 0xff;
-        int red = (i >> 16) & 0xff;
-        int green = (i >> 8) & 0xff;
-        int blue = (i >> 0) & 0xff;
+    public static void debugByteQuad(final String message, final int i) {
+        final int alpha = (i >> 24) & 0xff;
+        final int red = (i >> 16) & 0xff;
+        final int green = (i >> 8) & 0xff;
+        final int blue = (i >> 0) & 0xff;
 
         System.out.println(message + ": " + "alpha: " + alpha + ", " + "red: "
                 + red + ", " + "green: " + green + ", " + "blue: " + blue);
     }
 
-    public static void debugIPQuad(String message, int i) {
-        int b1 = (i >> 24) & 0xff;
-        int b2 = (i >> 16) & 0xff;
-        int b3 = (i >> 8) & 0xff;
-        int b4 = (i >> 0) & 0xff;
+    public static void debugIPQuad(final String message, final int i) {
+        final int b1 = (i >> 24) & 0xff;
+        final int b2 = (i >> 16) & 0xff;
+        final int b3 = (i >> 8) & 0xff;
+        final int b4 = (i >> 0) & 0xff;
 
         System.out.println(message + ": " + "b1: " + b1 + ", " + "b2: " + b2
                 + ", " + "b3: " + b3 + ", " + "b4: " + b4);
     }
 
-    public static void debugIPQuad(String message, byte bytes[]) {
+    public static void debugIPQuad(final String message, final byte bytes[]) {
         System.out.print(message + ": ");
         if (bytes == null) {
             System.out.print("null");
@@ -684,13 +684,13 @@ public final class Debug {
         System.out.println();
     }
 
-    public static String getDebug(String prefix, Dimension r) {
+    public static String getDebug(final String prefix, final Dimension r) {
         String s_ar1 = "null";
         String s_ar2 = "null";
 
         if (r != null) {
-            double aspect_ratio = ((double) r.width) / ((double) r.height);
-            double aspect_ratio2 = 1.0 / aspect_ratio;
+            final double aspect_ratio = ((double) r.width) / ((double) r.height);
+            final double aspect_ratio2 = 1.0 / aspect_ratio;
 
             s_ar1 = "" + aspect_ratio;
             s_ar2 = "" + aspect_ratio2;
@@ -708,17 +708,17 @@ public final class Debug {
                 + " aspect_ratio: " + s_ar1 + " (" + s_ar2 + ")");
     }
 
-    public static void debug(String prefix, Dimension r) {
+    public static void debug(final String prefix, final Dimension r) {
         debug(getDebug(prefix, r));
     }
 
-    public static String getDebug(String prefix, Rectangle r) {
+    public static String getDebug(final String prefix, final Rectangle r) {
         String s_ar1 = "null";
         String s_ar2 = "null";
 
         if (r != null) {
-            double aspect_ratio = ((double) r.width) / ((double) r.height);
-            double aspect_ratio2 = 1.0 / aspect_ratio;
+            final double aspect_ratio = ((double) r.width) / ((double) r.height);
+            final double aspect_ratio2 = 1.0 / aspect_ratio;
 
             s_ar1 = "" + aspect_ratio;
             s_ar2 = "" + aspect_ratio2;
@@ -738,68 +738,68 @@ public final class Debug {
                 + s_ar2 + ")");
     }
 
-    public static String getDebug(String prefix, Point p) {
+    public static String getDebug(final String prefix, final Point p) {
         return (prefix + ": " + ((p == null) ? "null" : (p.x + ", " + p.y)));
     }
 
-    public static void dump(String prefix, Object value) {
+    public static void dump(final String prefix, final Object value) {
         if (value == null) {
             debug(prefix, "null");
         } else if (value instanceof Object[]) {
-            Object[] array = (Object[]) value;
+            final Object[] array = (Object[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 dump(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof int[]) {
-            int[] array = (int[]) value;
+            final int[] array = (int[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 debug(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof char[]) {
-            char[] array = (char[]) value;
+            final char[] array = (char[]) value;
             debug(prefix, "[" + new String(array) + "]");
         } else if (value instanceof long[]) {
-            long[] array = (long[]) value;
+            final long[] array = (long[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 debug(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof boolean[]) {
-            boolean[] array = (boolean[]) value;
+            final boolean[] array = (boolean[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 debug(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof byte[]) {
-            byte[] array = (byte[]) value;
+            final byte[] array = (byte[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 debug(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof float[]) {
-            float[] array = (float[]) value;
+            final float[] array = (float[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 debug(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof double[]) {
-            double[] array = (double[]) value;
+            final double[] array = (double[]) value;
             debug(prefix, array);
             for (int i = 0; i < array.length; i++) {
                 debug(prefix + "\t" + i + ": ", array[i]);
             }
         } else if (value instanceof java.util.List) {
-            java.util.List<?> list = (java.util.List<?>) value;
+            final java.util.List<?> list = (java.util.List<?>) value;
             debug(prefix, "list");
             for (int i = 0; i < list.size(); i++) {
                 dump(prefix + "\t" + "list: " + i + ": ", list.get(i));
             }
         } else if (value instanceof Map) {
-            java.util.Map<?,?> map = (java.util.Map<?,?>) value;
+            final java.util.Map<?,?> map = (java.util.Map<?,?>) value;
             debug(prefix, "map");
-            for (Map.Entry<?,?> entry : map.entrySet()) {
+            for (final Map.Entry<?,?> entry : map.entrySet()) {
                 dump(prefix + "\t" + "map: " + entry.getKey() + " -> ", entry.getValue());
             }
         // } else if (value instanceof String) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugInputStream.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugInputStream.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugInputStream.java Tue Dec  4 17:23:16 2012
@@ -23,7 +23,7 @@ import java.io.InputStream;
 public class DebugInputStream extends InputStream {
     private final InputStream is;
 
-    public DebugInputStream(InputStream is) {
+    public DebugInputStream(final InputStream is) {
         this.is = is;
     }
 
@@ -31,14 +31,14 @@ public class DebugInputStream extends In
 
     @Override
     public int read() throws IOException {
-        int result = is.read();
+        final int result = is.read();
         bytes_read++;
         return result;
     }
 
     @Override
-    public long skip(long n) throws IOException {
-        long result = is.skip(n);
+    public long skip(final long n) throws IOException {
+        final long result = is.skip(n);
         bytes_read += n;
         return result;
     }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugOutputStream.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugOutputStream.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/DebugOutputStream.java Tue Dec  4 17:23:16 2012
@@ -30,19 +30,19 @@ public class DebugOutputStream extends O
     }
 
     @Override
-    public void write(int b) throws IOException {
+    public void write(final int b) throws IOException {
         os.write(b);
         count++;
     }
 
     @Override
-    public void write(byte b[]) throws IOException {
+    public void write(final byte b[]) throws IOException {
         os.write(b);
         count += b.length;
     }
 
     @Override
-    public void write(byte b[], int off, int len) throws IOException {
+    public void write(final byte b[], final int off, final int len) throws IOException {
         os.write(b, off, len);
         count += len;
     }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/IoUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/IoUtils.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/IoUtils.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/IoUtils.java Tue Dec  4 17:23:16 2012
@@ -55,7 +55,7 @@ public class IoUtils implements ImagingC
             is = new BufferedInputStream(is);
 
             int count;
-            byte[] buffer = new byte[4096];
+            final byte[] buffer = new byte[4096];
             while ((count = is.read(buffer, 0, 4096)) > 0) {
                 os.write(buffer, 0, count);
             }
@@ -68,7 +68,7 @@ public class IoUtils implements ImagingC
                 if (os != null) {
                     os.close();
                 }
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 Debug.debug(e);
             }
         }
@@ -83,7 +83,7 @@ public class IoUtils implements ImagingC
      * @return A byte array containing the contents of the File
      * @see InputStream
      */
-    public static byte[] getFileBytes(File file) throws IOException {
+    public static byte[] getFileBytes(final File file) throws IOException {
         InputStream is = null;
 
         try {
@@ -95,13 +95,13 @@ public class IoUtils implements ImagingC
                 if (is != null) {
                     is.close();
                 }
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 Debug.debug(e);
             }
         }
     }
 
-    public static void writeToFile(byte[] src, File file) throws IOException {
+    public static void writeToFile(final byte[] src, final File file) throws IOException {
         ByteArrayInputStream stream = null;
 
         try {
@@ -113,14 +113,14 @@ public class IoUtils implements ImagingC
                 if (stream != null) {
                     stream.close();
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 Debug.debug(e);
 
             }
         }
     }
 
-    public static void putInputStreamToFile(InputStream src, File file)
+    public static void putInputStreamToFile(final InputStream src, final File file)
             throws IOException {
         FileOutputStream stream = null;
 
@@ -138,19 +138,19 @@ public class IoUtils implements ImagingC
                 if (stream != null) {
                     stream.close();
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 Debug.debug(e);
             }
         }
     }
 
-    public static void copyStreamToStream(InputStream src, OutputStream dst)
+    public static void copyStreamToStream(final InputStream src, final OutputStream dst)
             throws IOException {
         copyStreamToStream(src, dst, true);
     }
 
-    public static void copyStreamToStream(InputStream src, OutputStream dst,
-            boolean close_streams) throws IOException {
+    public static void copyStreamToStream(final InputStream src, final OutputStream dst,
+            final boolean close_streams) throws IOException {
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
 
@@ -159,7 +159,7 @@ public class IoUtils implements ImagingC
             bos = new BufferedOutputStream(dst);
 
             int count;
-            byte[] buffer = new byte[4096];
+            final byte[] buffer = new byte[4096];
             while ((count = bis.read(buffer, 0, buffer.length)) > 0) {
                 dst.write(buffer, 0, count);
             }
@@ -170,14 +170,14 @@ public class IoUtils implements ImagingC
                     if (bis != null) {
                         bis.close();
                     }
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     Debug.debug(e);
                 }
                 try {
                     if (bos != null) {
                         bos.close();
                     }
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     Debug.debug(e);
                 }
             }
@@ -185,7 +185,7 @@ public class IoUtils implements ImagingC
 
     }
 
-    public static final boolean copyFileNio(File src, File dst)
+    public static final boolean copyFileNio(final File src, final File dst)
             throws IOException {
         FileChannel srcChannel = null, dstChannel = null;
         try {
@@ -200,8 +200,8 @@ public class IoUtils implements ImagingC
 
             {
                 // long theoretical_max = (64 * 1024 * 1024) - (32 * 1024);
-                int safe_max = (64 * 1024 * 1024) / 4;
-                long size = srcChannel.size();
+                final int safe_max = (64 * 1024 * 1024) / 4;
+                final long size = srcChannel.size();
                 long position = 0;
                 while (position < size) {
                     position += srcChannel.transferTo(position, safe_max,
@@ -221,7 +221,7 @@ public class IoUtils implements ImagingC
                 if (srcChannel != null) {
                     srcChannel.close();
                 }
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 Debug.debug(e);
 
             }
@@ -229,7 +229,7 @@ public class IoUtils implements ImagingC
                 if (dstChannel != null) {
                     dstChannel.close();
                 }
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 Debug.debug(e);
             }
         }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/ParamMap.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/ParamMap.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/ParamMap.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/ParamMap.java Tue Dec  4 17:23:16 2012
@@ -21,10 +21,10 @@ import java.util.Map;
 
 public class ParamMap {
 
-    public static boolean getParamBoolean(Map<String,Object> params, Object key,
-            boolean default_value) {
+    public static boolean getParamBoolean(final Map<String,Object> params, final Object key,
+            final boolean default_value) {
         boolean result = default_value;
-        Object o = params == null ? null : params.get(key);
+        final Object o = params == null ? null : params.get(key);
         if (o != null && o instanceof Boolean) {
             result = ((Boolean) o).booleanValue();
         }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/UnicodeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/UnicodeUtils.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/UnicodeUtils.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/UnicodeUtils.java Tue Dec  4 17:23:16 2012
@@ -26,12 +26,12 @@ public abstract class UnicodeUtils {
     private UnicodeUtils() {
     }
 
-    public static final boolean isValidISO_8859_1(String s) {
+    public static final boolean isValidISO_8859_1(final String s) {
         try {
-            String roundtrip = new String(s.getBytes("ISO-8859-1"),
+            final String roundtrip = new String(s.getBytes("ISO-8859-1"),
                     "ISO-8859-1");
             return s.equals(roundtrip);
-        } catch (UnsupportedEncodingException e) {
+        } catch (final UnsupportedEncodingException e) {
             // should never be thrown.
             throw new RuntimeException("Error parsing string.", e);
         }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingGuessFormatTest.java Tue Dec  4 17:23:16 2012
@@ -63,14 +63,14 @@ public class ImagingGuessFormatTest exte
         testGuess(ImageFormat.IMAGE_FORMAT_UNKNOWN, UNKNOWN_IMAGE_FILE);
     }
 
-    public void testGuess(ImageFormat expectedFormat, String imagePath)
+    public void testGuess(final ImageFormat expectedFormat, String imagePath)
             throws Exception {
         imagePath = FilenameUtils.separatorsToSystem(imagePath);
-        File imageFile = new File(TEST_IMAGE_FOLDER, imagePath);
+        final File imageFile = new File(TEST_IMAGE_FOLDER, imagePath);
 
         assertTrue(imageFile.exists());
         assertTrue(imageFile.isFile());
-        ImageFormat guessedFormat = Imaging.guessFormat(imageFile);
+        final ImageFormat guessedFormat = Imaging.guessFormat(imageFile);
         assertNotNull(guessedFormat);
         assertEquals(guessedFormat, expectedFormat);
     }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java?rev=1417043&r1=1417042&r2=1417043&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java Tue Dec  4 17:23:16 2012
@@ -33,20 +33,20 @@ import org.apache.commons.imaging.util.D
 public abstract class ImagingTest extends TestCase implements
         ImagingTestConstants, ImagingConstants {
 
-    protected File createTempFile(String prefix, String suffix)
+    protected File createTempFile(final String prefix, final String suffix)
             throws IOException {
-        File tempFolder = new File("tmp");
+        final File tempFolder = new File("tmp");
         if (!tempFolder.exists()) {
             tempFolder.mkdirs();
         }
         assertTrue(tempFolder.isDirectory());
 
-        File result = File.createTempFile(prefix, suffix, tempFolder);
+        final File result = File.createTempFile(prefix, suffix, tempFolder);
         result.deleteOnExit();
         return result;
     }
 
-    public void compareByteArrays(byte a[], byte b[]) {
+    public void compareByteArrays(final byte a[], final byte b[]) {
         assertTrue(a.length == b.length);
         for (int i = 0; i < b.length; i++) {
             assertTrue(b[i] == a[i]);
@@ -59,12 +59,12 @@ public abstract class ImagingTest extend
             Thread.sleep(50);
             System.runFinalization();
             Thread.sleep(50);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             Debug.debug(e);
         }
     }
 
-    protected boolean isPhilHarveyTestImage(File file) {
+    protected boolean isPhilHarveyTestImage(final File file) {
         // Debug.debug("isPhilHarveyTestImage file", file.getAbsolutePath());
         // Debug.debug("isPhilHarveyTestImage folder",
         // PHIL_HARVEY_TEST_IMAGE_FOLDER.getAbsolutePath());
@@ -83,16 +83,16 @@ public abstract class ImagingTest extend
     protected File getTestImageByName(final String filename)
             throws IOException, ImageReadException {
         return getTestImage(new ImageFilter() {
-            public boolean accept(File file) throws IOException,
+            public boolean accept(final File file) throws IOException,
                     ImageReadException {
                 return file.getName().equals(filename);
             }
         });
     }
 
-    protected File getTestImage(ImageFilter filter) throws IOException,
+    protected File getTestImage(final ImageFilter filter) throws IOException,
             ImageReadException {
-        List<File> images = getTestImages(filter, 1);
+        final List<File> images = getTestImages(filter, 1);
 
         assertTrue(images.size() > 0);
 
@@ -103,7 +103,7 @@ public abstract class ImagingTest extend
         return getTestImages(null, -1);
     }
 
-    protected List<File> getTestImages(ImageFilter filter) throws IOException,
+    protected List<File> getTestImages(final ImageFilter filter) throws IOException,
             ImageReadException {
         return getTestImages(filter, -1);
     }
@@ -121,9 +121,9 @@ public abstract class ImagingTest extend
         Debug.debug("imagesFolder", imagesFolder);
         assertTrue(imagesFolder.exists());
 
-        FileSystemTraversal.Visitor visitor = new FileSystemTraversal.Visitor() {
+        final FileSystemTraversal.Visitor visitor = new FileSystemTraversal.Visitor() {
 
-            public boolean visit(File file, double progressEstimate) {
+            public boolean visit(final File file, final double progressEstimate) {
                 if (!Imaging.hasImageFileExtension(file)) {
                     return true;
                 }
@@ -140,7 +140,7 @@ public abstract class ImagingTest extend
         int counter = 0;
 
         for (int i = 0; i < ALL_IMAGES.size(); i++) {
-            File file = ALL_IMAGES.get(i);
+            final File file = ALL_IMAGES.get(i);
 
             if (!Imaging.hasImageFileExtension(file)) {
                 continue;
@@ -170,7 +170,7 @@ public abstract class ImagingTest extend
         return images;
     }
 
-    protected boolean isInvalidPNGTestFile(File file) {
+    protected boolean isInvalidPNGTestFile(final File file) {
         return (file.getParentFile().getName().equalsIgnoreCase("pngsuite") && file
                 .getName().toLowerCase().startsWith("x"));
     }



Mime
View raw message