Skip to content

Commit fa07dea

Browse files
committed
CSV-71 - Add convenience Methods to CSVLexer
Use convenience fields from Lexer parent class; missed one method replacement earlier git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1303933 13f79535-47bb-0310-9956-ffa450edef68
1 parent 523171e commit fa07dea

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/org/apache/commons/csv/CSVLexer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Token nextToken(Token tkn) throws IOException {
5656
c = in.readAgain();
5757

5858
// empty line detection: eol AND (last char was EOL or beginning)
59-
if (format.isEmptyLinesIgnored()) {
59+
if (emptyLinesIgnored) {
6060
while (eol
6161
&& (lastChar == '\n' || lastChar == '\r' || lastChar == ExtendedBufferedReader.UNDEFINED)
6262
&& !isEndOfFile(lastChar)) {
@@ -74,15 +74,15 @@ Token nextToken(Token tkn) throws IOException {
7474
}
7575

7676
// did we reach eof during the last iteration already ? EOF
77-
if (isEndOfFile(lastChar) || (lastChar != format.getDelimiter() && isEndOfFile(c))) {
77+
if (isEndOfFile(lastChar) || (isDelimiter(lastChar) && isEndOfFile(c))) {
7878
tkn.type = EOF;
7979
return tkn;
8080
}
8181

8282
// important: make sure a new char gets consumed in each iteration
8383
while (!tkn.isReady && tkn.type != EOF) {
8484
// ignore whitespaces at beginning of a token
85-
if (format.isLeadingSpacesIgnored()) {
85+
if (leadingSpacesIgnored) {
8686
while (isWhitespace(c) && !eol) {
8787
wsBuf.append((char) c);
8888
c = in.read();
@@ -115,7 +115,7 @@ Token nextToken(Token tkn) throws IOException {
115115
} else {
116116
// next token must be a simple token
117117
// add removed blanks when not ignoring whitespace chars...
118-
if (!format.isLeadingSpacesIgnored()) {
118+
if (!leadingSpacesIgnored) {
119119
tkn.content.append(wsBuf);
120120
}
121121
simpleTokenLexer(tkn, c);
@@ -167,7 +167,7 @@ private Token simpleTokenLexer(Token tkn, int c) throws IOException {
167167
c = in.read();
168168
}
169169

170-
if (format.isTrailingSpacesIgnored()) {
170+
if (trailingSpacesIgnored) {
171171
trimTrailingSpaces(tkn.content);
172172
}
173173

0 commit comments

Comments
 (0)