commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1545223 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging: common/mylzw/ formats/jpeg/ formats/jpeg/exif/ formats/jpeg/iptc/ formats/jpeg/xmp/ formats/png/ formats/tiff/ formats/tiff/write/ palette/ util/
Date Mon, 25 Nov 2013 11:16:34 GMT
Author: ebourg
Date: Mon Nov 25 11:16:33 2013
New Revision: 1545223

URL: http://svn.apache.org/r1545223
Log:
foreach loops

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegPhotoshopMetadata.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffContents.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterBase.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossless.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossy.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSummary.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorGroup.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutMostPopulatedBoxesImplementation.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/mylzw/MyLzwCompressor.java Mon Nov 25 11:16:33 2013
@@ -58,7 +58,7 @@ public class MyLzwCompressor {
         InitializeStringTable();
     }
 
-    private final void InitializeStringTable() {
+    private void InitializeStringTable() {
         codeSize = initialCodeSize;
 
         final int intial_entries_count = (1 << codeSize) + 2;
@@ -73,18 +73,18 @@ public class MyLzwCompressor {
         }
     }
 
-    private final void clearTable() {
+    private void clearTable() {
         InitializeStringTable();
         incrementCodeSize();
     }
 
-    private final void incrementCodeSize() {
+    private void incrementCodeSize() {
         if (codeSize != 12) {
             codeSize++;
         }
     }
 
-    private final ByteArray arrayToKey(final byte b) {
+    private ByteArray arrayToKey(final byte b) {
         return arrayToKey(new byte[] { b, }, 0, 1);
     }
 
@@ -137,11 +137,11 @@ public class MyLzwCompressor {
         }
     }
 
-    private final ByteArray arrayToKey(final byte bytes[], final int start, final int length) {
+    private ByteArray arrayToKey(final byte bytes[], final int start, final int length) {
         return new ByteArray(bytes, start, length);
     }
 
-    private final void writeDataCode(final MyBitOutputStream bos, final int code)
+    private void writeDataCode(final MyBitOutputStream bos, final int code)
             throws IOException {
         if (null != listener) {
             listener.dataCode(code);
@@ -149,32 +149,32 @@ public class MyLzwCompressor {
         writeCode(bos, code);
     }
 
-    private final void writeClearCode(final MyBitOutputStream bos) throws IOException {
+    private void writeClearCode(final MyBitOutputStream bos) throws IOException {
         if (null != listener) {
             listener.dataCode(clearCode);
         }
         writeCode(bos, clearCode);
     }
 
-    private final void writeEoiCode(final MyBitOutputStream bos) throws IOException {
+    private void writeEoiCode(final MyBitOutputStream bos) throws IOException {
         if (null != listener) {
             listener.eoiCode(eoiCode);
         }
         writeCode(bos, eoiCode);
     }
 
-    private final void writeCode(final MyBitOutputStream bos, final int code)
+    private void writeCode(final MyBitOutputStream bos, final int code)
             throws IOException {
         bos.writeBits(code, codeSize);
     }
 
-    private final boolean isInTable(final byte bytes[], final int start, final int length) {
+    private boolean isInTable(final byte bytes[], final int start, final int length) {
         final ByteArray key = arrayToKey(bytes, start, length);
 
         return map.containsKey(key);
     }
 
-    private final int codeFromString(final byte bytes[], final int start, final int length)
+    private int codeFromString(final byte bytes[], final int start, final int length)
             throws IOException {
         final ByteArray key = arrayToKey(bytes, start, length);
         final Integer code = map.get(key);
@@ -184,13 +184,13 @@ public class MyLzwCompressor {
         return code;
     }
 
-    private final boolean addTableEntry(final MyBitOutputStream bos, final byte bytes[],
+    private boolean addTableEntry(final MyBitOutputStream bos, final byte bytes[],
             final int start, final int length) throws IOException {
         final ByteArray key = arrayToKey(bytes, start, length);
         return addTableEntry(bos, key);
     }
 
-    private final boolean addTableEntry(final MyBitOutputStream bos, final ByteArray key)
+    private boolean addTableEntry(final MyBitOutputStream bos, final ByteArray key)
             throws IOException {
         boolean cleared = false;
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java Mon Nov 25 11:16:33 2013
@@ -100,9 +100,8 @@ public class JpegImageMetadata implement
             return null;
         }
         final List<? extends IImageMetadataItem> dirs = exif.getDirectories();
-        for (int i = 0; i < dirs.size(); i++) {
-            final TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) dirs
-                    .get(i);
+        for (IImageMetadataItem d : dirs) {
+            final TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) d;
 
             byte[] data = null;
             if (dir.getJpegImageData() != null) {
@@ -133,9 +132,8 @@ public class JpegImageMetadata implement
         }
 
         final List<? extends IImageMetadataItem> dirs = exif.getDirectories();
-        for (int i = 0; i < dirs.size(); i++) {
-            final TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) dirs
-                    .get(i);
+        for (IImageMetadataItem d : dirs) {
+            final TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) d;
             // Debug.debug("dir", dir);
             BufferedImage image = dir.getThumbnail();
             if (null != image) {
@@ -174,9 +172,8 @@ public class JpegImageMetadata implement
             return null;
         }
         final List<? extends IImageMetadataItem> dirs = exif.getDirectories();
-        for (int i = 0; i < dirs.size(); i++) {
-            final TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) dirs
-                    .get(i);
+        for (IImageMetadataItem d : dirs) {
+            final TiffImageMetadata.Directory dir = (TiffImageMetadata.Directory) d;
             // Debug.debug("dir", dir);
             final TiffImageData rawImageData = dir.getTiffImageData();
             if (null != rawImageData) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java Mon Nov 25 11:16:33 2013
@@ -61,7 +61,7 @@ import org.apache.commons.imaging.util.D
 public class JpegImageParser extends ImageParser {
     private static final String DEFAULT_EXTENSION = ".jpg";
     private static final String ACCEPTED_EXTENSIONS[] = { ".jpg", ".jpeg", };
-    public static final boolean permissive = true;
+    public static final boolean PERMISSIVE = true;
     
     public JpegImageParser() {
         setByteOrder(ByteOrder.BIG_ENDIAN);
@@ -204,32 +204,32 @@ public class JpegImageParser extends Ima
         }
     }
 
-    private byte[] assembleSegments(final List<App2Segment> v, final boolean start_with_zero)
+    private byte[] assembleSegments(final List<App2Segment> segments, final boolean start_with_zero)
             throws ImageReadException {
-        if (v.isEmpty()) {
+        if (segments.isEmpty()) {
             throw new ImageReadException("No App2 Segments Found.");
         }
 
-        final int markerCount = v.get(0).num_markers;
+        final int markerCount = segments.get(0).num_markers;
 
         // if (permissive && (markerCount == 0))
         // markerCount = v.size();
 
-        if (v.size() != markerCount) {
+        if (segments.size() != markerCount) {
             throw new ImageReadException("App2 Segments Missing.  Found: "
-                    + v.size() + ", Expected: " + markerCount + ".");
+                    + segments.size() + ", Expected: " + markerCount + ".");
         }
 
-        Collections.sort(v);
+        Collections.sort(segments);
 
         final int offset = start_with_zero ? 0 : 1;
 
         int total = 0;
-        for (int i = 0; i < v.size(); i++) {
-            final App2Segment segment = v.get(i);
+        for (int i = 0; i < segments.size(); i++) {
+            final App2Segment segment = segments.get(i);
 
             if ((i + offset) != segment.cur_marker) {
-                dumpSegments(v);
+                dumpSegments(segments);
                 throw new ImageReadException(
                         "Incoherent App2 Segment Ordering.  i: " + i
                                 + ", segment[" + i + "].cur_marker: "
@@ -237,7 +237,7 @@ public class JpegImageParser extends Ima
             }
 
             if (markerCount != segment.num_markers) {
-                dumpSegments(v);
+                dumpSegments(segments);
                 throw new ImageReadException(
                         "Inconsistent App2 Segment Count info.  markerCount: "
                                 + markerCount + ", segment[" + i
@@ -250,11 +250,8 @@ public class JpegImageParser extends Ima
         final byte result[] = new byte[total];
         int progress = 0;
 
-        for (int i = 0; i < v.size(); i++) {
-            final App2Segment segment = v.get(i);
-
-            System.arraycopy(segment.icc_bytes, 0, result, progress,
-                    segment.icc_bytes.length);
+        for (App2Segment segment : segments) {
+            System.arraycopy(segment.icc_bytes, 0, result, progress, segment.icc_bytes.length);
             progress += segment.icc_bytes.length;
         }
 
@@ -288,8 +285,8 @@ public class JpegImageParser extends Ima
         final List<App2Segment> filtered = new ArrayList<App2Segment>();
         if (segments != null) {
             // throw away non-icc profile app2 segments.
-            for (int i = 0; i < segments.size(); i++) {
-                final App2Segment segment = (App2Segment) segments.get(i);
+            for (Segment s : segments) {
+                final App2Segment segment = (App2Segment) s;
                 if (segment.icc_bytes != null) {
                     filtered.add(segment);
                 }
@@ -334,11 +331,11 @@ public class JpegImageParser extends Ima
         return startsWith(segment.getSegmentData(), JpegConstants.EXIF_IDENTIFIER_CODE);
     }
 
-    private List<Segment> filterAPP1Segments(final List<Segment> v) {
+    private List<Segment> filterAPP1Segments(final List<Segment> segments) {
         final List<Segment> result = new ArrayList<Segment>();
 
-        for (int i = 0; i < v.size(); i++) {
-            final GenericSegment segment = (GenericSegment) v.get(i);
+        for (Segment s : segments) {
+            final GenericSegment segment = (GenericSegment) s;
             if (isExifAPP1Segment(segment)) {
                 result.add(segment);
             }
@@ -588,8 +585,8 @@ public class JpegImageParser extends Ima
 
         PhotoshopApp13Data photoshopApp13Data = null;
 
-        for (int i = 0; i < segments.size(); i++) {
-            final App13Segment segment = (App13Segment) segments.get(i);
+        for (Segment s : segments) {
+            final App13Segment segment = (App13Segment) s;
 
             final PhotoshopApp13Data data = segment.parsePhotoshopSegment(params);
             if (data != null && photoshopApp13Data != null) {
@@ -801,8 +798,8 @@ public class JpegImageParser extends Ima
         final List<String> Comments = new ArrayList<String>();
         final List<Segment> commentSegments = readSegments(byteSource,
                 new int[] { JpegConstants.COMMarker }, false);
-        for (int i = 0; i < commentSegments.size(); i++) {
-            final ComSegment comSegment = (ComSegment) commentSegments.get(i);
+        for (Segment commentSegment : commentSegments) {
+            final ComSegment comSegment = (ComSegment) commentSegment;
             String comment = "";
             try {
                 comment = new String(comSegment.getComment(), "UTF-8");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegPhotoshopMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegPhotoshopMetadata.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegPhotoshopMetadata.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegPhotoshopMetadata.java Mon Nov 25 11:16:33 2013
@@ -34,8 +34,7 @@ public class JpegPhotoshopMetadata exten
 
         final List<IptcRecord> records = photoshopApp13Data.getRecords();
         Collections.sort(records, IptcRecord.COMPARATOR);
-        for (int j = 0; j < records.size(); j++) {
-            final IptcRecord element = records.get(j);
+        for (IptcRecord element : records) {
             if (element.iptcType != IptcTypes.RECORD_VERSION) {
                 add(element.getIptcTypeName(), element.getValue());
             }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java Mon Nov 25 11:16:33 2013
@@ -55,7 +55,7 @@ public class ExifRewriter extends Binary
      * extension.
      */
     public ExifRewriter() {
-        setByteOrder(ByteOrder.NETWORK);
+        this(ByteOrder.NETWORK);
     }
 
     /**
@@ -503,8 +503,7 @@ public class ExifRewriter extends Binary
 
             boolean hasExif = false;
 
-            for (int i = 0; i < segments.size(); i++) {
-                final JFIFPiece piece = segments.get(i);
+            for (final JFIFPiece piece : segments) {
                 if (piece instanceof JFIFPieceSegmentExif) {
                     hasExif = true;
                 }
@@ -531,8 +530,7 @@ public class ExifRewriter extends Binary
 
             boolean APP1Written = false;
 
-            for (int i = 0; i < segments.size(); i++) {
-                final JFIFPiece piece = segments.get(i);
+            for (final JFIFPiece piece : segments) {
                 if (piece instanceof JFIFPieceSegmentExif) {
                     // only replace first APP1 segment; skips others.
                     if (APP1Written) {
@@ -544,13 +542,13 @@ public class ExifRewriter extends Binary
                         continue;
                     }
 
-                    final byte markerBytes[] = toBytes((short)JpegConstants.JPEG_APP1_Marker);
+                    final byte markerBytes[] = toBytes((short) JpegConstants.JPEG_APP1_Marker);
                     if (newBytes.length > 0xffff) {
                         throw new ExifOverflowException(
                                 "APP1 Segment is too long: " + newBytes.length);
                     }
                     final int markerLength = newBytes.length + 2;
-                    final byte markerLengthBytes[] = toBytes((short)markerLength);
+                    final byte markerLengthBytes[] = toBytes((short) markerLength);
 
                     os.write(markerBytes);
                     os.write(markerLengthBytes);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java Mon Nov 25 11:16:33 2013
@@ -108,11 +108,9 @@ public class IptcParser extends BinaryFi
             IOException {
         final List<IptcRecord> records = new ArrayList<IptcRecord>();
 
-        final List<IptcBlock> allBlocks = parseAllBlocks(bytes, verbose, strict);
-
-        for (int i = 0; i < allBlocks.size(); i++) {
-            final IptcBlock block = allBlocks.get(i);
+        final List<IptcBlock> blocks = parseAllBlocks(bytes, verbose, strict);
 
+        for (IptcBlock block : blocks) {
             // Ignore everything but IPTC data.
             if (!block.isIPTCBlock()) {
                 continue;
@@ -121,7 +119,7 @@ public class IptcParser extends BinaryFi
             records.addAll(parseIPTCBlock(block.blockData, verbose));
         }
 
-        return new PhotoshopApp13Data(records, allBlocks);
+        return new PhotoshopApp13Data(records, blocks);
     }
 
     protected List<IptcRecord> parseIPTCBlock(final byte bytes[], final boolean verbose)
@@ -376,9 +374,7 @@ public class IptcParser extends BinaryFi
         JpegConstants.PHOTOSHOP_IDENTIFICATION_STRING.writeTo(bos);
 
         final List<IptcBlock> blocks = data.getRawBlocks();
-        for (int i = 0; i < blocks.size(); i++) {
-            final IptcBlock block = blocks.get(i);
-
+        for (IptcBlock block : blocks) {
             bos.write4Bytes(JpegConstants.CONST_8BIM);
 
             if (block.blockType < 0 || block.blockType > 0xffff) {
@@ -443,13 +439,11 @@ public class IptcParser extends BinaryFi
             // TODO: make sure order right
     
             // write the list.
-            for (int i = 0; i < elements.size(); i++) {
-                final IptcRecord element = elements.get(i);
-    
+            for (IptcRecord element : elements) {
                 if (element.iptcType == IptcTypes.RECORD_VERSION) {
                     continue; // ignore
                 }
-    
+
                 bos.write(IptcConstants.IPTC_RECORD_TAG_MARKER);
                 bos.write(IptcConstants.IPTC_APPLICATION_2_RECORD_NUMBER);
                 if (element.iptcType.getType() < 0
@@ -458,13 +452,13 @@ public class IptcParser extends BinaryFi
                             + element.iptcType.getType());
                 }
                 bos.write(element.iptcType.getType());
-    
+
                 final byte recordData[] = element.value.getBytes("ISO-8859-1");
                 if (!new String(recordData, "ISO-8859-1").equals(element.value)) {
                     throw new ImageWriteException(
                             "Invalid record value, not ISO-8859-1");
                 }
-    
+
                 bos.write2Bytes(recordData.length);
                 bos.write(recordData);
             }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/PhotoshopApp13Data.java Mon Nov 25 11:16:33 2013
@@ -40,8 +40,7 @@ public class PhotoshopApp13Data {
 
     public List<IptcBlock> getNonIptcBlocks() {
         final List<IptcBlock> result = new ArrayList<IptcBlock>();
-        for (int i = 0; i < rawBlocks.size(); i++) {
-            final IptcBlock block = rawBlocks.get(i);
+        for (IptcBlock block : rawBlocks) {
             if (!block.isIPTCBlock()) {
                 result.add(block);
             }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java Mon Nov 25 11:16:33 2013
@@ -241,8 +241,7 @@ public class JpegRewriter extends Binary
             final SegmentFilter filter, final boolean reverse) {
         final List<T> result = new ArrayList<T>();
 
-        for (int i = 0; i < segments.size(); i++) {
-            final T piece = segments.get(i);
+        for (T piece : segments) {
             if (piece instanceof JFIFPieceSegment) {
                 if (filter.filter((JFIFPieceSegment) piece) ^ !reverse) {
                     result.add(piece);
@@ -313,9 +312,8 @@ public class JpegRewriter extends Binary
         boolean canThrow = false;
         try {
             JpegConstants.SOI.writeTo(os);
-    
-            for (int i = 0; i < segments.size(); i++) {
-                final JFIFPiece piece = segments.get(i);
+
+            for (JFIFPiece piece : segments) {
                 piece.write(os);
             }
             canThrow = true;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java Mon Nov 25 11:16:33 2013
@@ -106,8 +106,7 @@ public class PngImageParser extends Imag
             throws ImageReadException, IOException {
         final List<PngChunk> chunks = readChunks(is, null, false);
         final List<String> chunkTypes = new ArrayList<String>();
-        for (int i = 0; i < chunks.size(); i++) {
-            final PngChunk chunk = chunks.get(i);
+        for (PngChunk chunk : chunks) {
             chunkTypes.add(getChunkTypeName(chunk.chunkType));
         }
         return chunkTypes;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngWriter.java Mon Nov 25 11:16:33 2013
@@ -563,8 +563,8 @@ public class PngWriter {
 
         if (params.containsKey(PngConstants.PARAM_KEY_PNG_TEXT_CHUNKS)) {
             final List<?> outputTexts = (List<?>) params.get(PngConstants.PARAM_KEY_PNG_TEXT_CHUNKS);
-            for (int i = 0; i < outputTexts.size(); i++) {
-                final PngText text = (PngText) outputTexts.get(i);
+            for (Object outputText : outputTexts) {
+                final PngText text = (PngText) outputText;
                 if (text instanceof PngText.Text) {
                     writeChunktEXt(os, (PngText.Text) text);
                 } else if (text instanceof PngText.Ztxt) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffContents.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffContents.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffContents.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffContents.java Mon Nov 25 11:16:33 2013
@@ -38,14 +38,11 @@ public class TiffContents {
 
         result.add(header);
 
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffDirectory directory = directories.get(i);
-
+        for (TiffDirectory directory : directories) {
             result.add(directory);
 
             final List<TiffField> fields = directory.entries;
-            for (int j = 0; j < fields.size(); j++) {
-                final TiffField field = fields.get(j);
+            for (TiffField field : fields) {
                 final TiffElement oversizeValue = field.getOversizeValueElement();
                 if (null != oversizeValue) {
                     result.add(oversizeValue);
@@ -64,9 +61,7 @@ public class TiffContents {
     }
 
     public TiffField findField(final TagInfo tag) throws ImageReadException {
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffDirectory directory = directories.get(i);
-
+        for (TiffDirectory directory : directories) {
             final TiffField field = directory.findField(tag);
             if (null != field) {
                 return field;
@@ -82,9 +77,7 @@ public class TiffContents {
         Collections.sort(elements, TiffElement.COMPARATOR);
 
         long lastEnd = 0;
-        for (int i = 0; i < elements.size(); i++) {
-            final TiffElement element = elements.get(i);
-
+        for (TiffElement element : elements) {
             if (element.offset > lastEnd) {
                 Debug.debug("\t" + "gap: " + (element.offset - lastEnd));
             }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java Mon Nov 25 11:16:33 2013
@@ -119,8 +119,7 @@ public class TiffDirectory extends TiffE
     }
 
     public void dump() {
-        for (int i = 0; i < entries.size(); i++) {
-            final TiffField entry = entries.get(i);
+        for (TiffField entry : entries) {
             entry.dump();
         }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java Mon Nov 25 11:16:33 2013
@@ -51,7 +51,7 @@ public class TiffField {
     private final byte[] value;
     private final ByteOrder byteOrder;
     private final int sortHint;
-    public static final String Attribute_Tag = "Tag";
+    public static final String ATTRIBUTE_TAG = "Tag";
     private static final Map<Object, List<TagInfo>> ALL_TAG_MAP = makeTagMap(
             AllTagConstants.ALL_TAGS);
 
@@ -185,8 +185,7 @@ public class TiffField {
         // }
 
         // first search for exact match.
-        for (int i = 0; i < possibleMatches.size(); i++) {
-            final TagInfo tagInfo = possibleMatches.get(i);
+        for (TagInfo tagInfo : possibleMatches) {
             if (tagInfo.directoryType == TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
                 // pass
                 continue;
@@ -196,9 +195,7 @@ public class TiffField {
         }
 
         // accept an inexact match.
-        for (int i = 0; i < possibleMatches.size(); i++) {
-            final TagInfo tagInfo = possibleMatches.get(i);
-
+        for (TagInfo tagInfo : possibleMatches) {
             if (tagInfo.directoryType == TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
                 // pass
                 continue;
@@ -212,9 +209,7 @@ public class TiffField {
         }
 
         // accept a wildcard match.
-        for (int i = 0; i < possibleMatches.size(); i++) {
-            final TagInfo tagInfo = possibleMatches.get(i);
-
+        for (TagInfo tagInfo : possibleMatches) {
             if (tagInfo.directoryType == TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
                 return tagInfo;
             }
@@ -567,14 +562,12 @@ public class TiffField {
         return (String) o;
     }
 
-    private static final Map<Object, List<TagInfo>> makeTagMap(
+    private static Map<Object, List<TagInfo>> makeTagMap(
             final List<TagInfo> tags) {
         // make sure to use the thread-safe version; this is shared state.
         final Map<Object, List<TagInfo>> map = new Hashtable<Object, List<TagInfo>>();
 
-        for (int i = 0; i < tags.size(); i++) {
-            final TagInfo tag = tags.get(i);
-
+        for (TagInfo tag : tags) {
             List<TagInfo> tagList = map.get(tag.tag);
             if (tagList == null) {
                 tagList = new ArrayList<TagInfo>();

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java Mon Nov 25 11:16:33 2013
@@ -54,18 +54,16 @@ import org.apache.commons.imaging.format
 public class TiffImageMetadata extends ImageMetadata implements
         TiffDirectoryConstants {
     public final TiffContents contents;
-    private static final Map<Object, Integer> tagCounts = countTags(AllTagConstants.ALL_TAGS);
+    private static final Map<Object, Integer> TAG_COUNTS = countTags(AllTagConstants.ALL_TAGS);
 
     public TiffImageMetadata(final TiffContents contents) {
         this.contents = contents;
     }
 
-    private static final Map<Object, Integer> countTags(final List<TagInfo> tags) {
+    private static Map<Object, Integer> countTags(final List<TagInfo> tags) {
         final Map<Object, Integer> map = new Hashtable<Object, Integer>();
 
-        for (int i = 0; i < tags.size(); i++) {
-            final TagInfo tag = tags.get(i);
-
+        for (TagInfo tag : tags) {
             final Integer count = map.get(tag.tag);
             if (count == null) {
                 map.put(tag.tag, 1);
@@ -133,9 +131,8 @@ public class TiffImageMetadata extends I
                         byteOrder);
 
                 final List<? extends IImageMetadataItem> entries = getItems();
-                for (int i = 0; i < entries.size(); i++) {
-                    final TiffImageMetadata.Item item = (TiffImageMetadata.Item) entries
-                            .get(i);
+                for (IImageMetadataItem entry : entries) {
+                    final TiffImageMetadata.Item item = (TiffImageMetadata.Item) entry;
                     final TiffField srcField = item.getTiffField();
 
                     if (null != dstDir.findField(srcField.getTag())) {
@@ -192,8 +189,8 @@ public class TiffImageMetadata extends I
         final List<IImageMetadataItem> result = new ArrayList<IImageMetadataItem>();
 
         final List<? extends IImageMetadataItem> items = super.getItems();
-        for (int i = 0; i < items.size(); i++) {
-            final Directory dir = (Directory) items.get(i);
+        for (IImageMetadataItem item : items) {
+            final Directory dir = (Directory) item;
             result.addAll(dir.getItems());
         }
 
@@ -220,9 +217,8 @@ public class TiffImageMetadata extends I
         final TiffOutputSet result = new TiffOutputSet(byteOrder);
 
         final List<? extends IImageMetadataItem> srcDirs = getDirectories();
-        for (int i = 0; i < srcDirs.size(); i++) {
-            final TiffImageMetadata.Directory srcDir = (TiffImageMetadata.Directory) srcDirs
-                    .get(i);
+        for (IImageMetadataItem srcDir1 : srcDirs) {
+            final Directory srcDir = (Directory) srcDir1;
 
             if (null != result.findDirectory(srcDir.type)) {
                 // Certain cameras right directories more than once.
@@ -246,14 +242,14 @@ public class TiffImageMetadata extends I
     public TiffField findField(final TagInfo tagInfo, final boolean exactDirectoryMatch)
             throws ImageReadException {
         // Please keep this method in sync with TiffField's getTag()
-        final Integer tagCount = tagCounts.get(tagInfo.tag);
+        final Integer tagCount = TAG_COUNTS.get(tagInfo.tag);
         final int tagsMatching = tagCount == null ? 0 : tagCount;
 
         final List<? extends IImageMetadataItem> directories = getDirectories();
         if (exactDirectoryMatch
                 || tagInfo.directoryType != TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN) {
-            for (int i = 0; i < directories.size(); i++) {
-                final Directory directory = (Directory) directories.get(i);
+            for (IImageMetadataItem directory1 : directories) {
+                final Directory directory = (Directory) directory1;
                 if (directory.type == tagInfo.directoryType.directoryType) {
                     final TiffField field = directory.findField(tagInfo);
                     if (field != null) {
@@ -264,8 +260,8 @@ public class TiffImageMetadata extends I
             if (exactDirectoryMatch || tagsMatching > 1) {
                 return null;
             }
-            for (int i = 0; i < directories.size(); i++) {
-                final Directory directory = (Directory) directories.get(i);
+            for (IImageMetadataItem directory1 : directories) {
+                final Directory directory = (Directory) directory1;
                 if (tagInfo.directoryType.isImageDirectory()
                         && directory.type >= 0) {
                     final TiffField field = directory.findField(tagInfo);
@@ -282,8 +278,8 @@ public class TiffImageMetadata extends I
             }
         }
 
-        for (int i = 0; i < directories.size(); i++) {
-            final Directory directory = (Directory) directories.get(i);
+        for (IImageMetadataItem directory1 : directories) {
+            final Directory directory = (Directory) directory1;
             final TiffField field = directory.findField(tagInfo);
             if (field != null) {
                 return field;
@@ -451,8 +447,8 @@ public class TiffImageMetadata extends I
 
     public TiffDirectory findDirectory(final int directoryType) {
         final List<? extends IImageMetadataItem> directories = getDirectories();
-        for (int i = 0; i < directories.size(); i++) {
-            final Directory directory = (Directory) directories.get(i);
+        for (IImageMetadataItem directory1 : directories) {
+            final Directory directory = (Directory) directory1;
             if (directory.type == directoryType) {
                 return directory.directory;
             }
@@ -463,8 +459,8 @@ public class TiffImageMetadata extends I
     public List<TiffField> getAllFields() {
         final List<TiffField> result = new ArrayList<TiffField>();
         final List<? extends IImageMetadataItem> directories = getDirectories();
-        for (int i = 0; i < directories.size(); i++) {
-            final Directory directory = (Directory) directories.get(i);
+        for (IImageMetadataItem directory1 : directories) {
+            final Directory directory = (Directory) directory1;
             result.addAll(directory.getAllFields());
         }
         return result;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageParser.java Mon Nov 25 11:16:33 2013
@@ -135,16 +135,13 @@ public class TiffImageParser extends Ima
 
         final TiffImageMetadata result = new TiffImageMetadata(contents);
 
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffDirectory dir = directories.get(i);
-
+        for (TiffDirectory dir : directories) {
             final TiffImageMetadata.Directory metadataDirectory = new TiffImageMetadata.Directory(
                     tiffReader.getByteOrder(), dir);
 
             final List<TiffField> entries = dir.getDirectoryEntries();
 
-            for (int j = 0; j < entries.size(); j++) {
-                final TiffField entry = entries.get(j);
+            for (TiffField entry : entries) {
                 metadataDirectory.add(entry);
             }
 
@@ -245,8 +242,7 @@ public class TiffImageParser extends Ima
 
         final List<String> comments = new ArrayList<String>();
         final List<TiffField> entries = directory.entries;
-        for (int i = 0; i < entries.size(); i++) {
-            final TiffField field = entries.get(i);
+        for (TiffField field : entries) {
             final String comment = field.toString();
             comments.add(comment);
         }
@@ -379,9 +375,7 @@ public class TiffImageParser extends Ima
 
                     // Debug.debug("directory offset", directory.offset);
 
-                    for (int i = 0; i < entries.size(); i++) {
-                        final TiffField field = entries.get(i);
-
+                    for (TiffField field : entries) {
                         field.dump(pw, Integer.toString(d));
                     }
                 }
@@ -422,8 +416,7 @@ public class TiffImageParser extends Ima
             final TiffDirectory directory = contents.directories.get(i);
             final List<ImageDataElement> dataElements = directory
                     .getTiffRawImageDataElements();
-            for (int j = 0; j < dataElements.size(); j++) {
-                final TiffDirectory.ImageDataElement element = dataElements.get(j);
+            for (ImageDataElement element : dataElements) {
                 final byte bytes[] = byteSource.getBlock(element.offset,
                         element.length);
                 result.add(bytes);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterBase.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterBase.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterBase.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterBase.java Mon Nov 25 11:16:33 2013
@@ -52,7 +52,7 @@ public abstract class TiffImageWriterBas
         this.byteOrder = byteOrder;
     }
 
-    protected final static int imageDataPaddingLength(final int dataLength) {
+    protected static int imageDataPaddingLength(final int dataLength) {
         return (4 - (dataLength % 4)) % 4;
     }
 
@@ -76,8 +76,7 @@ public abstract class TiffImageWriterBas
 
         final List<Integer> directoryIndices = new ArrayList<Integer>();
         final Map<Integer, TiffOutputDirectory> directoryTypeMap = new HashMap<Integer, TiffOutputDirectory>();
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffOutputDirectory directory = directories.get(i);
+        for (TiffOutputDirectory directory : directories) {
             final int dirType = directory.type;
             directoryTypeMap.put(dirType, directory);
             // Debug.debug("validating dirType", dirType + " ("
@@ -85,32 +84,32 @@ public abstract class TiffImageWriterBas
 
             if (dirType < 0) {
                 switch (dirType) {
-                case DIRECTORY_TYPE_EXIF:
-                    if (exifDirectory != null) {
-                        throw new ImageWriteException(
-                                "More than one EXIF directory.");
-                    }
-                    exifDirectory = directory;
-                    break;
+                    case DIRECTORY_TYPE_EXIF:
+                        if (exifDirectory != null) {
+                            throw new ImageWriteException(
+                                    "More than one EXIF directory.");
+                        }
+                        exifDirectory = directory;
+                        break;
 
-                case DIRECTORY_TYPE_GPS:
-                    if (gpsDirectory != null) {
-                        throw new ImageWriteException(
-                                "More than one GPS directory.");
-                    }
-                    gpsDirectory = directory;
-                    break;
+                    case DIRECTORY_TYPE_GPS:
+                        if (gpsDirectory != null) {
+                            throw new ImageWriteException(
+                                    "More than one GPS directory.");
+                        }
+                        gpsDirectory = directory;
+                        break;
 
-                case DIRECTORY_TYPE_INTEROPERABILITY:
-                    if (interoperabilityDirectory != null) {
-                        throw new ImageWriteException(
-                                "More than one Interoperability directory.");
-                    }
-                    interoperabilityDirectory = directory;
-                    break;
-                default:
-                    throw new ImageWriteException("Unknown directory: "
-                            + dirType);
+                    case DIRECTORY_TYPE_INTEROPERABILITY:
+                        if (interoperabilityDirectory != null) {
+                            throw new ImageWriteException(
+                                    "More than one Interoperability directory.");
+                        }
+                        interoperabilityDirectory = directory;
+                        break;
+                    default:
+                        throw new ImageWriteException("Unknown directory: "
+                                + dirType);
                 }
             } else {
                 if (directoryIndices.contains(dirType)) {
@@ -124,9 +123,7 @@ public abstract class TiffImageWriterBas
 
             final HashSet<Integer> fieldTags = new HashSet<Integer>();
             final List<TiffOutputField> fields = directory.getFields();
-            for (int j = 0; j < fields.size(); j++) {
-                final TiffOutputField field = fields.get(j);
-
+            for (TiffOutputField field : fields) {
                 if (fieldTags.contains(field.tag)) {
                     throw new ImageWriteException("Tag ("
                             + field.tagInfo.getDescription()

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossless.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossless.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossless.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossless.java Mon Nov 25 11:16:33 2013
@@ -76,13 +76,11 @@ public class TiffImageWriterLossless ext
             // result.add(contents.header); // ?
 
             final List<TiffDirectory> directories = contents.directories;
-            for (int d = 0; d < directories.size(); d++) {
-                final TiffDirectory directory = directories.get(d);
+            for (TiffDirectory directory : directories) {
                 elements.add(directory);
 
                 final List<TiffField> fields = directory.getDirectoryEntries();
-                for (int f = 0; f < fields.size(); f++) {
-                    final TiffField field = fields.get(f);
+                for (TiffField field : fields) {
                     final TiffElement oversizeValue = field.getOversizeValueElement();
                     if (oversizeValue != null) {
                         final TiffOutputField frozenField = frozenFields.get(field.getTag());
@@ -103,11 +101,8 @@ public class TiffImageWriterLossless ext
 
                 final TiffImageData tiffImageData = directory.getTiffImageData();
                 if (tiffImageData != null) {
-                    final TiffElement.DataElement data[] = tiffImageData
-                            .getImageData();
-                    for (final DataElement element : data) {
-                        elements.add(element);
-                    }
+                    final DataElement data[] = tiffImageData.getImageData();
+                    Collections.addAll(elements, data);
                 }
             }
 
@@ -121,8 +116,7 @@ public class TiffImageWriterLossless ext
                 // int last = TIFF_HEADER_SIZE;
                 TiffElement start = null;
                 long index = -1;
-                for (int i = 0; i < elements.size(); i++) {
-                    final TiffElement element = elements.get(i);
+                for (TiffElement element : elements) {
                     final long lastElementByte = element.offset + element.length;
                     if (start == null) {
                         start = element;
@@ -242,8 +236,7 @@ public class TiffImageWriterLossless ext
             // search for the smallest possible element large enough to hold the
             // item.
             TiffElement bestFit = null;
-            for (int i = 0; i < unusedElements.size(); i++) {
-                final TiffElement element = unusedElements.get(i);
+            for (TiffElement element : unusedElements) {
                 if (element.length >= outputItemLength) {
                     bestFit = element;
                 } else {
@@ -324,10 +317,9 @@ public class TiffImageWriterLossless ext
 
         // zero out the parsed pieces of old exif segment, in case we don't
         // overwrite them.
-        for (int i = 0; i < analysis.size(); i++) {
-            final TiffElement element = analysis.get(i);
+        for (TiffElement element : analysis) {
             for (int j = 0; j < element.length; j++) {
-                final int index = (int)(element.offset + j);
+                final int index = (int) (element.offset + j);
                 if (index < output.length) {
                     output[index] = 0;
                 }
@@ -335,11 +327,9 @@ public class TiffImageWriterLossless ext
         }
 
         // write in the new items
-        for (int i = 0; i < outputItems.size(); i++) {
-            final TiffOutputItem outputItem = outputItems.get(i);
-
+        for (TiffOutputItem outputItem : outputItems) {
             final BufferOutputStream tos = new BufferOutputStream(output,
-                    (int)outputItem.getOffset());
+                    (int) outputItem.getOffset());
             final BinaryOutputStream bos = new BinaryOutputStream(tos, byteOrder);
             outputItem.writeItem(bos);
         }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossy.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossy.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossy.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffImageWriterLossy.java Mon Nov 25 11:16:33 2013
@@ -54,9 +54,7 @@ public class TiffImageWriterLossy extend
     private void updateOffsetsStep(final List<TiffOutputItem> outputItems) {
         int offset = TIFF_HEADER_SIZE;
 
-        for (int i = 0; i < outputItems.size(); i++) {
-            final TiffOutputItem outputItem = outputItems.get(i);
-
+        for (TiffOutputItem outputItem : outputItems) {
             outputItem.setOffset(offset);
             final int itemLength = outputItem.getItemLength();
             offset += itemLength;
@@ -71,9 +69,7 @@ public class TiffImageWriterLossy extend
             ImageWriteException {
         writeImageFileHeader(bos);
 
-        for (int i = 0; i < outputItems.size(); i++) {
-            final TiffOutputItem outputItem = outputItems.get(i);
-
+        for (TiffOutputItem outputItem : outputItems) {
             outputItem.writeItem(bos);
 
             final int length = outputItem.getItemLength();

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectory.java Mon Nov 25 11:16:33 2013
@@ -420,8 +420,7 @@ public final class TiffOutputDirectory e
 
     public void removeField(final int tag) {
         final List<TiffOutputField> matches = new ArrayList<TiffOutputField>();
-        for (int i = 0; i < fields.size(); i++) {
-            final TiffOutputField field = fields.get(i);
+        for (TiffOutputField field : fields) {
             if (field.tag == tag) {
                 matches.add(field);
             }
@@ -434,8 +433,7 @@ public final class TiffOutputDirectory e
     }
 
     public TiffOutputField findField(final int tag) {
-        for (int i = 0; i < fields.size(); i++) {
-            final TiffOutputField field = fields.get(i);
+        for (TiffOutputField field : fields) {
             if (field.tag == tag) {
                 return field;
             }
@@ -466,8 +464,7 @@ public final class TiffOutputDirectory e
         bos.write2Bytes(fields.size()); // DirectoryFieldCount
 
         // Write Fields
-        for (int i = 0; i < fields.size(); i++) {
-            final TiffOutputField field = fields.get(i);
+        for (TiffOutputField field : fields) {
             field.writeField(bos);
 
             // Debug.debug("\t" + "writing field (" + field.tag + ", 0x" +
@@ -616,8 +613,7 @@ public final class TiffOutputDirectory e
         result.add(this);
         sortFields();
 
-        for (int i = 0; i < fields.size(); i++) {
-            final TiffOutputField field = fields.get(i);
+        for (TiffOutputField field : fields) {
             if (field.isLocalValue()) {
                 continue;
             }
@@ -628,9 +624,7 @@ public final class TiffOutputDirectory e
         }
 
         if (null != imageDataInfo) {
-            for (final TiffOutputItem outputItem : imageDataInfo.outputItems) {
-                result.add(outputItem);
-            }
+            Collections.addAll(result, imageDataInfo.outputItems);
 
             outputSummary.addTiffImageData(imageDataInfo);
         }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java Mon Nov 25 11:16:33 2013
@@ -58,7 +58,7 @@ public class TiffOutputField implements 
         }
     }
 
-    protected static final TiffOutputField createOffsetField(final TagInfo tagInfo,
+    protected static TiffOutputField createOffsetField(final TagInfo tagInfo,
             final ByteOrder byteOrder) throws ImageWriteException {
         return new TiffOutputField(tagInfo, FieldType.LONG, 1,
                 FieldType.LONG.writeData(0, byteOrder));

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSet.java Mon Nov 25 11:16:33 2013
@@ -45,9 +45,7 @@ public final class TiffOutputSet impleme
             final TiffOutputSummary outputSummary) throws ImageWriteException {
         final List<TiffOutputItem> result = new ArrayList<TiffOutputItem>();
 
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffOutputDirectory directory = directories.get(i);
-
+        for (TiffOutputDirectory directory : directories) {
             result.addAll(directory.getOutputItems(outputSummary));
         }
 
@@ -117,8 +115,7 @@ public final class TiffOutputSet impleme
     }
 
     public TiffOutputDirectory findDirectory(final int directoryType) {
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffOutputDirectory directory = directories.get(i);
+        for (TiffOutputDirectory directory : directories) {
             if (directory.type == directoryType) {
                 return directory;
             }
@@ -197,8 +194,7 @@ public final class TiffOutputSet impleme
     }
 
     public void removeField(final int tag) {
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffOutputDirectory directory = directories.get(i);
+        for (TiffOutputDirectory directory : directories) {
             directory.removeField(tag);
         }
     }
@@ -208,8 +204,7 @@ public final class TiffOutputSet impleme
     }
 
     public TiffOutputField findField(final int tag) {
-        for (int i = 0; i < directories.size(); i++) {
-            final TiffOutputDirectory directory = directories.get(i);
+        for (TiffOutputDirectory directory : directories) {
             final TiffOutputField field = directory.findField(tag);
             if (null != field) {
                 return field;
@@ -276,8 +271,7 @@ public final class TiffOutputSet impleme
                     prefix, i, directory.description(), directory.type));
 
             final List<TiffOutputField> fields = directory.getFields();
-            for (int j = 0; j < fields.size(); j++) {
-                final TiffOutputField field = fields.get(j);
+            for (TiffOutputField field : fields) {
                 result.append(prefix);
                 result.append("\t\tfield " + i + ": " + field.tagInfo);
                 result.append(NEWLINE);

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=1545223&r1=1545222&r2=1545223&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 Mon Nov 25 11:16:33 2013
@@ -58,20 +58,16 @@ class TiffOutputSummary implements TiffC
     }
 
     public void updateOffsets(final ByteOrder byteOrder) throws ImageWriteException {
-        for (int i = 0; i < offsetItems.size(); i++) {
-            final OffsetItem offset = offsetItems.get(i);
-
+        for (OffsetItem offset : offsetItems) {
             final byte value[] = FieldType.LONG.writeData(
-                    (int)offset.item.getOffset(), byteOrder);
+                    (int) offset.item.getOffset(), byteOrder);
             offset.itemOffsetField.setData(value);
         }
 
-        for (int i = 0; i < imageDataItems.size(); i++) {
-            final ImageDataOffsets imageDataInfo = imageDataItems.get(i);
-
+        for (ImageDataOffsets imageDataInfo : imageDataItems) {
             for (int j = 0; j < imageDataInfo.outputItems.length; j++) {
                 final TiffOutputItem item = imageDataInfo.outputItems[j];
-                imageDataInfo.imageDataOffsets[j] = (int)item.getOffset();
+                imageDataInfo.imageDataOffsets[j] = (int) item.getOffset();
             }
 
             imageDataInfo.imageDataOffsetsField.setData(FieldType.LONG

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorGroup.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorGroup.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorGroup.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/ColorGroup.java Mon Nov 25 11:16:33 2013
@@ -56,8 +56,7 @@ class ColorGroup {
         }
 
         int total = 0;
-        for (int i = 0; i < color_counts.size(); i++) {
-            final ColorCount color = color_counts.get(i);
+        for (ColorCount color : color_counts) {
             total += color.count;
 
             min_alpha = Math.min(min_alpha, color.alpha);
@@ -108,9 +107,7 @@ class ColorGroup {
         long count_total = 0;
         long alpha_total = 0, red_total = 0, green_total = 0, blue_total = 0;
 
-        for (int i = 0; i < color_counts.size(); i++) {
-            final ColorCount color = color_counts.get(i);
-
+        for (ColorCount color : color_counts) {
             count_total += color.count;
             alpha_total += color.count * color.alpha;
             red_total += color.count * color.red;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutMostPopulatedBoxesImplementation.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutMostPopulatedBoxesImplementation.java?rev=1545223&r1=1545222&r2=1545223&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutMostPopulatedBoxesImplementation.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/MedianCutMostPopulatedBoxesImplementation.java Mon Nov 25 11:16:33 2013
@@ -30,12 +30,11 @@ public class MedianCutMostPopulatedBoxes
             final boolean ignoreAlpha) throws ImageWriteException {
         int maxPoints = 0;
         ColorGroup colorGroup = null;
-        for (int i = 0; i < colorGroups.size(); i++) {
-            if (colorGroups.get(i).max_diff > 0) {
-                final ColorGroup c = colorGroups.get(i);
-                if (c.totalPoints > maxPoints) {
-                    colorGroup = c;
-                    maxPoints = c.totalPoints;
+        for (ColorGroup group : colorGroups) {
+            if (group.max_diff > 0) {
+                if (group.totalPoints > maxPoints) {
+                    colorGroup = group;
+                    maxPoints = group.totalPoints;
                 }
             }
         }

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=1545223&r1=1545222&r2=1545223&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 Mon Nov 25 11:16:33 2013
@@ -237,9 +237,7 @@ public class PaletteFactory {
         DivisionCandidate best_v = null;
         double best_score = Double.MAX_VALUE;
 
-        for (int i = 0; i < dcs.size(); i++) {
-            final DivisionCandidate dc = dcs.get(i);
-
+        for (DivisionCandidate dc : dcs) {
             final ColorSpaceSubset first = dc.dst_a;
             final ColorSpaceSubset second = dc.dst_b;
             final int area1 = first.total;
@@ -280,8 +278,7 @@ public class PaletteFactory {
             int max_area = -1;
             ColorSpaceSubset max_subset = null;
 
-            for (int i = 0; i < v.size(); i++) {
-                final ColorSpaceSubset subset = v.get(i);
+            for (ColorSpaceSubset subset : v) {
                 if (ignore.contains(subset)) {
                     continue;
                 }

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=1545223&r1=1545222&r2=1545223&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 Mon Nov 25 11:16:33 2013
@@ -34,7 +34,7 @@ public final class Debug {
 
     private static final boolean DEBUG = false;
     // public static String newline = System.getProperty("line.separator");
-    public static final String newline = "\r\n";
+    public static final String NEWLINE = "\r\n";
     private static long counter = 0;
 
     public static void debug(final String message) {
@@ -59,7 +59,7 @@ public final class Debug {
 
     public static void newline() {
         if (DEBUG) {
-            System.out.print(newline);
+            System.out.print(NEWLINE);
         }
     }
 
@@ -83,13 +83,13 @@ public final class Debug {
         final StringBuilder result = new StringBuilder();
 
         if (v == null) {
-            result.append(message + " (" + null + ")" + newline);
+            result.append(message + " (" + null + ")" + NEWLINE);
         } else {
-            result.append(message + " (" + v.length + ")" + newline);
+            result.append(message + " (" + v.length + ")" + NEWLINE);
             for (final int element : v) {
-                result.append("\t" + element + newline);
+                result.append("\t" + element + NEWLINE);
             }
-            result.append(newline);
+            result.append(NEWLINE);
         }
         return result.toString();
     }
@@ -104,9 +104,9 @@ public final class Debug {
         final StringBuilder result = new StringBuilder();
 
         if (v == null) {
-            result.append(message + " (" + null + ")" + newline);
+            result.append(message + " (" + null + ")" + NEWLINE);
         } else {
-            result.append(message + " (" + v.length + ")" + newline);
+            result.append(message + " (" + v.length + ")" + NEWLINE);
             for (int i = 0; i < max && i < v.length; i++) {
                 final int b = 0xff & v[i];
 
@@ -118,13 +118,13 @@ public final class Debug {
                 }
 
                 result.append("\t" + i + ": " + b + " (" + c + ", 0x"
-                        + Integer.toHexString(b) + ")" + newline);
+                        + Integer.toHexString(b) + ")" + NEWLINE);
             }
             if (v.length > max) {
-                result.append("\t..." + newline);
+                result.append("\t..." + NEWLINE);
             }
 
-            result.append(newline);
+            result.append(NEWLINE);
         }
         return result.toString();
     }
@@ -133,14 +133,14 @@ public final class Debug {
         final StringBuilder result = new StringBuilder();
 
         if (v == null) {
-            result.append(getDebug(message + " (" + null + ")") + newline);
+            result.append(getDebug(message + " (" + null + ")") + NEWLINE);
         } else {
-            result.append(getDebug(message + " (" + v.length + ")") + newline);
+            result.append(getDebug(message + " (" + v.length + ")") + NEWLINE);
             for (final char element : v) {
                 result.append(getDebug("\t" + element + " (" + (0xff & element))
-                        + ")" + newline);
+                        + ")" + NEWLINE);
             }
-            result.append(newline);
+            result.append(NEWLINE);
         }
         return result.toString();
     }
@@ -150,13 +150,11 @@ public final class Debug {
 
         final String suffix = " [" + counter++ + "]";
 
-        result.append(getDebug(message + " (" + v.size() + ")" + suffix)
-                + newline);
-        for (int i = 0; i < v.size(); i++) {
-            result.append(getDebug("\t" + v.get(i).toString() + suffix)
-                    + newline);
+        result.append(getDebug(message + " (" + v.size() + ")" + suffix) + NEWLINE);
+        for (Object aV : v) {
+            result.append(getDebug("\t" + aV.toString() + suffix) + NEWLINE);
         }
-        result.append(newline);
+        result.append(NEWLINE);
 
         return result.toString();
     }
@@ -173,16 +171,16 @@ public final class Debug {
         }
 
         final List<Object> keys = new ArrayList<Object>(map.keySet());
-        result.append(getDebug(message + " map: " + keys.size()) + newline);
+        result.append(getDebug(message + " map: " + keys.size()) + NEWLINE);
         for (int i = 0; i < keys.size(); i++) {
             final Object key = keys.get(i);
             final Object value = map.get(key);
             result.append(getDebug("\t" + i + ": '" + key + "' -> '" + value
                     + "'")
-                    + newline);
+                    + NEWLINE);
         }
 
-        result.append(newline);
+        result.append(NEWLINE);
 
         return result.toString();
     }
@@ -194,7 +192,7 @@ public final class Debug {
     private static void log(final StringBuilder buffer, final String s) {
         Debug.debug(s);
         if (buffer != null) {
-            buffer.append(s + newline);
+            buffer.append(s + NEWLINE);
         }
     }
 
@@ -223,8 +221,7 @@ public final class Debug {
 
         boolean result = true;
 
-        for (int i = 0; i < keys_a.size(); i++) {
-            final Object key = keys_a.get(i);
+        for (Object key : keys_a) {
             if (!keys_b.contains(key)) {
                 log(buffer, prefix + "b is missing key '" + key + "' from a");
                 result = false;
@@ -239,9 +236,7 @@ public final class Debug {
                 }
             }
         }
-        for (int i = 0; i < keys_b.size(); i++) {
-            final Object key = keys_b.get(i);
-
+        for (Object key : keys_b) {
             log(buffer, prefix + "a is missing key '" + key + "' from b");
             result = false;
         }
@@ -286,17 +281,17 @@ public final class Debug {
 
         result.append(getDebug("ICC_Profile " + message + ": "
                 + ((value == null) ? "null" : value.toString()))
-                + newline);
+                + NEWLINE);
         if (value != null) {
             result.append(getDebug("\t getProfileClass: "
                     + byteQuadToString(value.getProfileClass()))
-                    + newline);
+                    + NEWLINE);
             result.append(getDebug("\t getPCSType: "
                     + byteQuadToString(value.getPCSType()))
-                    + newline);
+                    + NEWLINE);
             result.append(getDebug("\t getColorSpaceType() : "
                     + byteQuadToString(value.getColorSpaceType()))
-                    + newline);
+                    + NEWLINE);
         }
 
         return result.toString();
@@ -457,18 +452,18 @@ public final class Debug {
         final StringBuilder result = new StringBuilder();
 
         if (value == null) {
-            result.append(getDebug(message, "null") + newline);
+            result.append(getDebug(message, "null") + NEWLINE);
         } else {
             result.append(getDebug(message, value.length));
             final int max = 10;
             for (int i = 0; i < value.length && i < max; i++) {
-                result.append(getDebug("\t" + i, value[i]) + newline);
+                result.append(getDebug("\t" + i, value[i]) + NEWLINE);
             }
             if (value.length > max) {
-                result.append(getDebug("\t...") + newline);
+                result.append(getDebug("\t...") + NEWLINE);
             }
         }
-        result.append(newline);
+        result.append(NEWLINE);
 
         return result.toString();
     }
@@ -545,8 +540,8 @@ public final class Debug {
         final String suffix = " [" + counter++ + "]";
 
         debug(message + " (" + v.size() + ")" + suffix);
-        for (int i = 0; i < v.size(); i++) {
-            debug("\t" + v.get(i).toString() + suffix);
+        for (Object aV : v) {
+            debug("\t" + aV.toString() + suffix);
         }
         debug();
     }
@@ -589,7 +584,7 @@ public final class Debug {
     }
 
     public static String getDebug(final String message, final Throwable e) {
-        return message + newline + getDebug(e);
+        return message + NEWLINE + getDebug(e);
     }
 
     public static String getDebug(final Throwable e) {
@@ -603,20 +598,20 @@ public final class Debug {
                 "yyyy-MM-dd kk:mm:ss:SSS", Locale.ENGLISH);
         final String datetime = timestamp.format(new Date()).toLowerCase();
 
-        result.append(newline);
+        result.append(NEWLINE);
         result.append("Throwable: "
                 + ((e == null) ? "" : ("(" + e.getClass().getName() + ")"))
-                + ":" + datetime + newline);
+                + ":" + datetime + NEWLINE);
         result.append("Throwable: "
-                + ((e == null) ? "null" : e.getLocalizedMessage()) + newline);
-        result.append(newline);
+                + ((e == null) ? "null" : e.getLocalizedMessage()) + NEWLINE);
+        result.append(NEWLINE);
 
         result.append(getStackTrace(e, max));
 
-        result.append("Caught here:" + newline);
+        result.append("Caught here:" + NEWLINE);
         result.append(getStackTrace(new Exception(), max, 1));
         // Debug.dumpStack();
-        result.append(newline);
+        result.append(NEWLINE);
         return result.toString();
     }
 
@@ -639,15 +634,15 @@ public final class Debug {
 
                     result.append("\tat " + ste.getClassName() + "."
                             + ste.getMethodName() + "(" + ste.getFileName()
-                            + ":" + ste.getLineNumber() + ")" + newline);
+                            + ":" + ste.getLineNumber() + ")" + NEWLINE);
                 }
                 if (limit >= 0 && stes.length > limit) {
-                    result.append("\t..." + newline);
+                    result.append("\t..." + NEWLINE);
                 }
             }
 
             // e.printStackTrace(System.out);
-            result.append(newline);
+            result.append(NEWLINE);
         }
 
         return result.toString();



Mime
View raw message