commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1390020 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging: ./ common/ formats/jpeg/ formats/png/ formats/pnm/ formats/rgbe/ formats/tiff/ formats/tiff/write/ util/
Date Tue, 25 Sep 2012 17:53:03 GMT
Author: damjan
Date: Tue Sep 25 17:53:02 2012
New Revision: 1390020

URL: http://svn.apache.org/viewvc?rev=1390020&view=rev
Log:
Goodbye StringBuffer.


Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/FormatCompliance.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ImageMetadata.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/png/PngImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/InfoHeaderReader.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/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/util/Debug.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/FormatCompliance.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/FormatCompliance.java?rev=1390020&r1=1390019&r2=1390020&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/FormatCompliance.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/FormatCompliance.java
Tue Sep 25 17:53:02 2012
@@ -132,7 +132,7 @@ public class FormatCompliance {
             if (actual == valid[i])
                 return true;
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append(name + ": " + "Unexpected value: (valid: ");
         if (valid.length > 1)
             result.append("{");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ImageMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ImageMetadata.java?rev=1390020&r1=1390019&r2=1390020&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ImageMetadata.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ImageMetadata.java
Tue Sep 25 17:53:02 2012
@@ -46,7 +46,7 @@ public class ImageMetadata implements II
         if (null == prefix)
             prefix = "";
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         for (int i = 0; i < items.size(); i++) {
             if (i > 0)
                 result.append(newline);

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -203,7 +203,7 @@ public class JpegImageMetadata implement
         if (prefix == null)
             prefix = "";
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         result.append(prefix);
         if (null == exif)

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -96,7 +96,7 @@ public class PngImageParser extends Imag
     // private final static int tRNS = CharsToQuad('t', 'R', 'N', 's');
 
     public static final String getChunkTypeName(int chunkType) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append((char) (0xff & (chunkType >> 24)));
         result.append((char) (0xff & (chunkType >> 16)));
         result.append((char) (0xff & (chunkType >> 8)));

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java?rev=1390020&r1=1390019&r2=1390020&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java
Tue Sep 25 17:53:02 2012
@@ -52,7 +52,7 @@ class WhiteSpaceReader {
         while (Character.isWhitespace(c))
             c = nextChar();
 
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
 
         while (!Character.isWhitespace(c)) {
             buffer.append(c);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/InfoHeaderReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/InfoHeaderReader.java?rev=1390020&r1=1390019&r2=1390020&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/InfoHeaderReader.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/InfoHeaderReader.java
Tue Sep 25 17:53:02 2012
@@ -35,7 +35,7 @@ class InfoHeaderReader {
     }
 
     public String readLine() throws IOException {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         char c;
 
         while ((c = read()) != '\n') {

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -56,7 +56,7 @@ public class TiffDirectory extends TiffE
 
         int entryOffset = offset + TIFF_DIRECTORY_HEADER_LENGTH;
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         for (int i = 0; i < entries.size(); i++) {
             TiffField entry = entries.get(i);
 

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -306,7 +306,7 @@ public class TiffField implements TiffCo
             return df.format((Date) o);
         } else if (o instanceof Object[]) {
             Object objects[] = (Object[]) o;
-            StringBuffer result = new StringBuffer();
+            StringBuilder result = new StringBuilder();
 
             for (int i = 0; i < objects.length; i++) {
                 Object object = objects[i];
@@ -506,7 +506,7 @@ public class TiffField implements TiffCo
 
     @Override
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         result.append(tag + " (0x" + Integer.toHexString(tag) + ": "
                 + tagInfo.name + "): ");

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -545,7 +545,7 @@ public class TiffImageMetadata extends I
             // latitude: 8 degrees, 40 minutes, 42.2 seconds S
             // longitude: 115 degrees, 26 minutes, 21.8 seconds E
 
-            StringBuffer result = new StringBuffer();
+            StringBuilder result = new StringBuilder();
             result.append("[GPS. ");
             result.append("Latitude: " + latitudeDegrees.toDisplayString()
                     + " degrees, " + latitudeMinutes.toDisplayString()

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -124,7 +124,7 @@ public class TiffOutputField implements 
     public String toString(String prefix) {
         if (prefix == null)
             prefix = "";
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         result.append(prefix);
         result.append(tagInfo);

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=1390020&r1=1390019&r2=1390020&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
Tue Sep 25 17:53:02 2012
@@ -252,7 +252,7 @@ public final class TiffOutputSet impleme
         if (prefix == null)
             prefix = "";
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         result.append(prefix);
         result.append("TiffOutputSet {");

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=1390020&r1=1390019&r2=1390020&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/util/Debug.java
Tue Sep 25 17:53:02 2012
@@ -77,7 +77,7 @@ public final class Debug {
     }
 
     public static String getDebug(String message, int v[]) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         if (v == null)
             result.append(message + " (" + null + ")" + newline);
@@ -97,7 +97,7 @@ public final class Debug {
 
     public static String getDebug(String message, byte v[], int max) {
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         if (v == null)
             result.append(message + " (" + null + ")" + newline);
@@ -124,7 +124,7 @@ public final class Debug {
     }
 
     public static String getDebug(String message, char v[]) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         if (v == null)
             result.append(getDebug(message + " (" + null + ")") + newline);
@@ -141,7 +141,7 @@ public final class Debug {
     private static long counter = 0;
 
     public static String getDebug(String message, java.util.List<?> v) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         String suffix = " [" + counter++ + "]";
 
@@ -160,7 +160,7 @@ public final class Debug {
     }
 
     public static String getDebug(String message, Map<?,?> map) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         if (map == null)
             return getDebug(message + " map: " + null);
@@ -187,14 +187,14 @@ public final class Debug {
     // public static String newline = System.getProperty("line.separator");
     public static final String newline = "\r\n";
 
-    private static void log(StringBuffer buffer, String s) {
+    private static void log(StringBuilder buffer, String s) {
         Debug.debug(s);
         if (buffer != null)
             buffer.append(s + newline);
     }
 
     public static boolean compare(String prefix, Map<?, ?> a, Map<?, ?> b, List<?>
ignore,
-            StringBuffer buffer) {
+            StringBuilder buffer) {
         if ((a == null) && (b == null)) {
             log(buffer, prefix + " both maps null");
             return true;
@@ -258,7 +258,7 @@ public final class Debug {
         char c3 = (char) b3;
         char c4 = (char) b4;
         // return new String(new char[] { c1, c2, c3, c4 });
-        StringBuffer fStringBuffer = new StringBuffer();
+        StringBuilder fStringBuffer = new StringBuilder();
         fStringBuffer.append(new String(new char[] { c1, c2, c3, c4 }));
         fStringBuffer.append(" bytequad: " + bytequad);
         fStringBuffer.append(" b1: " + b1);
@@ -271,7 +271,7 @@ public final class Debug {
 
     public static String getDebug(String message, ICC_Profile value) {
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         result.append(getDebug("ICC_Profile " + message + ": "
                 + ((value == null) ? "null" : value.toString()))
@@ -439,7 +439,7 @@ public final class Debug {
     }
 
     public static String getDebug(String message, Object value[]) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         if (value == null) {
             result.append(getDebug(message, "null") + newline);
@@ -581,7 +581,7 @@ public final class Debug {
     }
 
     public static String getDebug(Throwable e, int max) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         final SimpleDateFormat timestamp = new SimpleDateFormat(
                 "yyyy-MM-dd kk:mm:ss:SSS");
@@ -613,7 +613,7 @@ public final class Debug {
     }
 
     public static String getStackTrace(Throwable e, int limit, int skip) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
 
         if (e != null) {
             StackTraceElement stes[] = e.getStackTrace();



Mime
View raw message