commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1303955 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java
Date Thu, 22 Mar 2012 18:23:22 GMT
Author: sebb
Date: Thu Mar 22 18:23:22 2012
New Revision: 1303955

URL: http://svn.apache.org/viewvc?rev=1303955&view=rev
Log:
CSV-80 - CSVLexer.nextToken does not need wsBuf
remove useless wsBuf

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java?rev=1303955&r1=1303954&r2=1303955&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java Thu Mar 22
18:23:22 2012
@@ -23,8 +23,6 @@ import static org.apache.commons.csv.Tok
 
 class CSVLexer extends Lexer {
 
-    private final StringBuilder wsBuf = new StringBuilder();
-    
     // ctor needs to be public so can be called dynamically by PerformanceTest class
     public CSVLexer(CSVFormat format, ExtendedBufferedReader in) {
         super(format, in);
@@ -41,7 +39,6 @@ class CSVLexer extends Lexer {
      */
     @Override
     Token nextToken(Token tkn) throws IOException {
-        wsBuf.setLength(0); // reuse
 
         // get the last read char (required for empty line detection)
         int lastChar = in.readAgain();
@@ -84,7 +81,6 @@ class CSVLexer extends Lexer {
             // ignore whitespaces at beginning of a token
             if (leadingSpacesIgnored) {
                 while (isWhitespace(c) && !eol) {
-                    wsBuf.append((char) c);
                     c = in.read();
                     eol = isEndOfLine(c);
                 }
@@ -115,9 +111,6 @@ class CSVLexer extends Lexer {
             } else {
                 // next token must be a simple token
                 // add removed blanks when not ignoring whitespace chars...
-                if (!leadingSpacesIgnored) {
-                    tkn.content.append(wsBuf);
-                }
                 simpleTokenLexer(tkn, c);
             }
         }



Mime
View raw message