commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1416992 - in /commons/proper/imaging/trunk/src: main/java/org/apache/commons/imaging/ main/java/org/apache/commons/imaging/formats/jpeg/decoder/ main/java/org/apache/commons/imaging/formats/pnm/ main/java/org/apache/commons/imaging/formats...
Date Tue, 04 Dec 2012 15:28:16 GMT
Author: ggregory
Date: Tue Dec  4 15:28:14 2012
New Revision: 1416992

URL: http://svn.apache.org/viewvc?rev=1416992&view=rev
Log:
Make some private fields final.

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/PixelDensity.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSummary.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/ico/IcoRoundtripTest.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/PixelDensity.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/PixelDensity.java?rev=1416992&r1=1416991&r2=1416992&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/PixelDensity.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/PixelDensity.java
Tue Dec  4 15:28:14 2012
@@ -21,10 +21,10 @@ package org.apache.commons.imaging;
  * storing image information.
  */
 public class PixelDensity {
-    private double horizontalDensity;
-    private double verticalDensity;
+    private final double horizontalDensity;
+    private final double verticalDensity;
     // / One-tenth of a millimetre units.
-    private int unitLength;
+    private final int unitLength;
 
     private PixelDensity(double horizontalDensity, double verticalDensity,
             int unitLength) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java?rev=1416992&r1=1416991&r2=1416992&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
Tue Dec  4 15:28:14 2012
@@ -48,12 +48,12 @@ public class JpegDecoder extends BinaryF
      * positive numbers.
      */
 
-    private DqtSegment.QuantizationTable[] quantizationTables = new DqtSegment.QuantizationTable[4];
-    private DhtSegment.HuffmanTable[] huffmanDCTables = new DhtSegment.HuffmanTable[4];
-    private DhtSegment.HuffmanTable[] huffmanACTables = new DhtSegment.HuffmanTable[4];
+    private final DqtSegment.QuantizationTable[] quantizationTables = new DqtSegment.QuantizationTable[4];
+    private final DhtSegment.HuffmanTable[] huffmanDCTables = new DhtSegment.HuffmanTable[4];
+    private final DhtSegment.HuffmanTable[] huffmanACTables = new DhtSegment.HuffmanTable[4];
     private SofnSegment sofnSegment;
     private SosSegment sosSegment;
-    private float[][] scaledQuantizationTables = new float[4][];
+    private final float[][] scaledQuantizationTables = new float[4][];
     private BufferedImage image = null;
     private ImageReadException imageReadException = null;
     private IOException ioException = null;
@@ -285,9 +285,9 @@ public class JpegDecoder extends BinaryF
         return mcu;
     }
 
-    private int[] zz = new int[64];
-    private int[] blockInt = new int[64];
-    private float[] block = new float[64];
+    private final int[] zz = new int[64];
+    private final int[] blockInt = new int[64];
+    private final float[] block = new float[64];
 
     private void readMCU(JpegInputStream is, int[] preds, Block[] mcu)
             throws IOException, ImageReadException {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java?rev=1416992&r1=1416991&r2=1416992&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PamFileInfo.java
Tue Dec  4 15:28:14 2012
@@ -25,11 +25,11 @@ import org.apache.commons.imaging.ImageI
 import org.apache.commons.imaging.ImageReadException;
 
 public class PamFileInfo extends FileInfo {
-    private int depth;
-    private int maxval;
+    private final int depth;
+    private final int maxval;
     private final float scale;
     private final int bytesPerSample; 
-    private boolean hasAlpha;
+    private final boolean hasAlpha;
     private final TupleReader tupleReader;
 
     PamFileInfo(int width, int height, int depth, int maxval, String tupleType) throws ImageReadException
{

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java?rev=1416992&r1=1416991&r2=1416992&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
Tue Dec  4 15:28:14 2012
@@ -314,8 +314,8 @@ public class TiffReader extends BinaryFi
 
     private static class Collector implements Listener {
         private TiffHeader tiffHeader = null;
-        private List<TiffDirectory> directories = new ArrayList<TiffDirectory>();
-        private List<TiffField> fields = new ArrayList<TiffField>();
+        private final List<TiffDirectory> directories = new ArrayList<TiffDirectory>();
+        private final List<TiffField> fields = new ArrayList<TiffField>();
         private final boolean readThumbnails;
 
         public Collector() {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSummary.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSummary.java?rev=1416992&r1=1416991&r2=1416992&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSummary.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSummary.java
Tue Dec  4 15:28:14 2012
@@ -49,7 +49,7 @@ class TiffOutputSummary implements TiffC
         }
     }
 
-    private List<OffsetItem> offsetItems = new ArrayList<OffsetItem>();
+    private final List<OffsetItem> offsetItems = new ArrayList<OffsetItem>();
 
     public void add(final TiffOutputItem item,
             final TiffOutputField itemOffsetField) {
@@ -78,7 +78,7 @@ class TiffOutputSummary implements TiffC
         }
     }
 
-    private List<ImageDataOffsets> imageDataItems = new ArrayList<ImageDataOffsets>();
+    private final List<ImageDataOffsets> imageDataItems = new ArrayList<ImageDataOffsets>();
 
     public void addTiffImageData(final ImageDataOffsets imageDataInfo) {
         imageDataItems.add(imageDataInfo);

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java?rev=1416992&r1=1416991&r2=1416992&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
Tue Dec  4 15:28:14 2012
@@ -50,7 +50,7 @@ public class BinaryFileFunctionsTest ext
         }
     }
 
-    private Extender extender = new Extender();
+    private final Extender extender = new Extender();
 
     public void testFloatToByteConversion() {
         extender.testFloatToByteConversion();

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=1416992&r1=1416991&r2=1416992&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 15:28:14 2012
@@ -53,7 +53,7 @@ public class IcoRoundtripTest extends Ic
         {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
     };
 
-    private Map<Integer,BitmapGenerator> generatorMap = new HashMap<Integer,BitmapGenerator>();
+    private final Map<Integer,BitmapGenerator> generatorMap = new HashMap<Integer,BitmapGenerator>();
 
     public IcoRoundtripTest() {
         generatorMap.put(1, new GeneratorFor1BitBitmaps());



Mime
View raw message