commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1545242 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging: formats/tiff/TiffField.java icc/IccProfileInfo.java util/Debug.java
Date Mon, 25 Nov 2013 12:18:28 GMT
Author: ebourg
Date: Mon Nov 25 12:18:28 2013
New Revision: 1545242

URL: http://svn.apache.org/r1545242
Log:
Replaced StringBuffers with StringBuilders

Modified:
    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/icc/IccProfileInfo.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/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=1545242&r1=1545241&r2=1545242&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 12:18:28 2013
@@ -347,7 +347,7 @@ public class TiffField {
         // } else if (o instanceof Number[])
         // {
         // Number numbers[] = (Number[]) o;
-        // StringBuffer result = new StringBuffer();
+        // StringBuilder result = new StringBuilder();
         //
         // for (int i = 0; i < numbers.length; i++)
         // {
@@ -361,7 +361,7 @@ public class TiffField {
         // }
         } else if (o instanceof short[]) {
             final short values[] = (short[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final short sval = values[i];
@@ -378,7 +378,7 @@ public class TiffField {
             return result.toString();
         } else if (o instanceof int[]) {
             final int values[] = (int[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final int iVal = values[i];
@@ -395,7 +395,7 @@ public class TiffField {
             return result.toString();
         } else if (o instanceof long[]) {
             final long values[] = (long[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final long lVal = values[i];
@@ -412,7 +412,7 @@ public class TiffField {
             return result.toString();
         } else if (o instanceof double[]) {
             final double values[] = (double[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final double dVal = values[i];
@@ -429,7 +429,7 @@ public class TiffField {
             return result.toString();
         } else if (o instanceof byte[]) {
             final byte values[] = (byte[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final byte bVal = values[i];
@@ -446,7 +446,7 @@ public class TiffField {
             return result.toString();
         } else if (o instanceof char[]) {
             final char values[] = (char[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final char cVal = values[i];
@@ -463,7 +463,7 @@ public class TiffField {
             return result.toString();
         } else if (o instanceof float[]) {
             final float values[] = (float[]) o;
-            final StringBuffer result = new StringBuffer();
+            final StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < values.length; i++) {
                 final float fVal = values[i];
@@ -482,7 +482,7 @@ public class TiffField {
         // else if (o instanceof short[])
         // {
         // short numbers[] = (short[]) o;
-        // StringBuffer result = new StringBuffer();
+        // StringBuilder result = new StringBuilder();
         //
         // for (int i = 0; i < numbers.length; i++)
         // {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java?rev=1545242&r1=1545241&r2=1545242&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileInfo.java
Mon Nov 25 12:18:28 2013
@@ -109,7 +109,6 @@ public class IccProfileInfo {
         final StringWriter sw = new StringWriter();
         final PrintWriter pw = new PrintWriter(sw);
 
-        // StringBuffer result = new StringBuffer();
         pw.println(prefix + ": " + "data length: " + data.length);
 
         printCharQuad(pw, prefix + ": " + "ProfileDeviceClassSignature",

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=1545242&r1=1545241&r2=1545242&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 12:18:28 2013
@@ -259,20 +259,20 @@ public final class Debug {
         final char c3 = (char) b3;
         final char c4 = (char) b4;
         // return new String(new char[] { c1, c2, c3, c4 });
-        final StringBuilder fStringBuffer = new StringBuilder(31);
-        fStringBuffer.append(new String(new char[] { c1, c2, c3, c4 }));
-        fStringBuffer.append(" bytequad: ");
-        fStringBuffer.append(bytequad);
-        fStringBuffer.append(" b1: ");
-        fStringBuffer.append(b1);
-        fStringBuffer.append(" b2: ");
-        fStringBuffer.append(b2);
-        fStringBuffer.append(" b3: ");
-        fStringBuffer.append(b3);
-        fStringBuffer.append(" b4: ");
-        fStringBuffer.append(b4);
+        final StringBuilder buffer = new StringBuilder(31);
+        buffer.append(new String(new char[]{c1, c2, c3, c4}));
+        buffer.append(" bytequad: ");
+        buffer.append(bytequad);
+        buffer.append(" b1: ");
+        buffer.append(b1);
+        buffer.append(" b2: ");
+        buffer.append(b2);
+        buffer.append(" b3: ");
+        buffer.append(b3);
+        buffer.append(" b4: ");
+        buffer.append(b4);
 
-        return fStringBuffer.toString();
+        return buffer.toString();
     }
 
     public static String getDebug(final String message, final ICC_Profile value) {



Mime
View raw message