pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1768575 - in /pdfbox/trunk: fontbox/src/main/java/org/apache/fontbox/cmap/ pdfbox/src/main/java/org/apache/pdfbox/pdfparser/ xmpbox/src/main/java/org/apache/xmpbox/
Date Mon, 07 Nov 2016 19:20:27 GMT
Author: tilman
Date: Mon Nov  7 19:20:27 2016
New Revision: 1768575

URL: http://svn.apache.org/viewvc?rev=1768575&view=rev
Log:
PDFBOX-2852: replace StringBuffer with StringBuilder, as suggested by Lorenz Pahl

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
    pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/DateConverter.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1768575&r1=1768574&r2=1768575&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java Mon Nov  7
19:20:27 2016
@@ -437,7 +437,7 @@ public class CMapParser
         {
             // header operations, for now return the entire line
             // may need to smarter in the future
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             buffer.append((char) nextByte);
             readUntilEndOfLine(is, buffer);
             retval = buffer.toString();
@@ -445,7 +445,7 @@ public class CMapParser
         }
         case '(':
         {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             int stringByte = is.read();
 
             while (stringByte != -1 && stringByte != ')')
@@ -559,7 +559,7 @@ public class CMapParser
         }
         case '/':
         {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             int stringByte = is.read();
 
             while (!isWhitespaceOrEOF(stringByte) && !isDelimiter(stringByte))
@@ -590,7 +590,7 @@ public class CMapParser
         case '8':
         case '9':
         {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             buffer.append((char) nextByte);
             nextByte = is.read();
 
@@ -613,7 +613,7 @@ public class CMapParser
         }
         default:
         {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder buffer = new StringBuilder();
             buffer.append((char) nextByte);
             nextByte = is.read();
 
@@ -636,7 +636,7 @@ public class CMapParser
         return retval;
     }
 
-    private void readUntilEndOfLine(InputStream is, StringBuffer buf) throws IOException
+    private void readUntilEndOfLine(InputStream is, StringBuilder buf) throws IOException
     {
         int nextByte = is.read();
         while (nextByte != -1 && nextByte != 0x0D && nextByte != 0x0A)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java?rev=1768575&r1=1768574&r2=1768575&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java Mon Nov
 7 19:20:27 2016
@@ -505,7 +505,7 @@ public abstract class BaseParser
                     case '6':
                     case '7':
                     {
-                        StringBuffer octal = new StringBuffer();
+                        StringBuilder octal = new StringBuilder();
                         octal.append( next );
                         c = seqSource.read();
                         char digit = (char)c;

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=1768575&r1=1768574&r2=1768575&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java Mon
Nov  7 19:20:27 2016
@@ -245,7 +245,7 @@ public class PDFStreamParser extends Bas
             {
                 /* We will be filling buf with the rest of the number.  Only
                  * allow 1 "." and "-" and "+" at start of number. */
-                StringBuffer buf = new StringBuffer();
+                StringBuilder buf = new StringBuilder();
                 buf.append( c );
                 seqSource.read();
 
@@ -422,7 +422,7 @@ public class PDFStreamParser extends Bas
 
         //average string size is around 2 and the normal string buffer size is
         //about 16 so lets save some space.
-        StringBuffer buffer = new StringBuffer(4);
+        StringBuilder buffer = new StringBuilder(4);
         int nextChar = seqSource.peek();
         while(
             nextChar != -1 && // EOF

Modified: pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/DateConverter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/DateConverter.java?rev=1768575&r1=1768574&r2=1768575&view=diff
==============================================================================
--- pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/DateConverter.java (original)
+++ pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/DateConverter.java Mon Nov  7 19:20:27
2016
@@ -289,7 +289,7 @@ public final class DateConverter
      */
     public static String toISO8601(Calendar cal, boolean printMillis)
     {
-        StringBuffer retval = new StringBuffer();
+        StringBuilder retval = new StringBuilder();
 
         retval.append(cal.get(Calendar.YEAR));
         retval.append("-");



Mime
View raw message