You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/03/22 19:00:44 UTC

svn commit: r1303933 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java

Author: sebb
Date: Thu Mar 22 18:00:43 2012
New Revision: 1303933

URL: http://svn.apache.org/viewvc?rev=1303933&view=rev
Log:
CSV-71 - Add convenience Methods to CSVLexer
Use convenience fields from Lexer parent class; missed one method replacement earlier

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=1303933&r1=1303932&r2=1303933&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:00:43 2012
@@ -56,7 +56,7 @@ class CSVLexer extends Lexer {
         c = in.readAgain();
 
         //  empty line detection: eol AND (last char was EOL or beginning)
-        if (format.isEmptyLinesIgnored()) {
+        if (emptyLinesIgnored) {
             while (eol
                     && (lastChar == '\n' || lastChar == '\r' || lastChar == ExtendedBufferedReader.UNDEFINED)
                     && !isEndOfFile(lastChar)) {
@@ -74,7 +74,7 @@ class CSVLexer extends Lexer {
         }
 
         // did we reach eof during the last iteration already ? EOF
-        if (isEndOfFile(lastChar) || (lastChar != format.getDelimiter() && isEndOfFile(c))) {
+        if (isEndOfFile(lastChar) || (isDelimiter(lastChar) && isEndOfFile(c))) {
             tkn.type = EOF;
             return tkn;
         }
@@ -82,7 +82,7 @@ class CSVLexer extends Lexer {
         //  important: make sure a new char gets consumed in each iteration
         while (!tkn.isReady && tkn.type != EOF) {
             // ignore whitespaces at beginning of a token
-            if (format.isLeadingSpacesIgnored()) {
+            if (leadingSpacesIgnored) {
                 while (isWhitespace(c) && !eol) {
                     wsBuf.append((char) c);
                     c = in.read();
@@ -115,7 +115,7 @@ class CSVLexer extends Lexer {
             } else {
                 // next token must be a simple token
                 // add removed blanks when not ignoring whitespace chars...
-                if (!format.isLeadingSpacesIgnored()) {
+                if (!leadingSpacesIgnored) {
                     tkn.content.append(wsBuf);
                 }
                 simpleTokenLexer(tkn, c);
@@ -167,7 +167,7 @@ class CSVLexer extends Lexer {
             c = in.read();
         }
 
-        if (format.isTrailingSpacesIgnored()) {
+        if (trailingSpacesIgnored) {
             trimTrailingSpaces(tkn.content);
         }