Skip to content

Commit 3655efc

Browse files
committed
Rename ivar to ignoreSurroundingSpaces to match CSVFormat.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397784 13f79535-47bb-0310-9956-ffa450edef68
1 parent 50e2719 commit 3655efc

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Token nextToken(final Token token) throws IOException {
9090
// important: make sure a new char gets consumed in each iteration
9191
while (token.type == INVALID) {
9292
// ignore whitespaces at beginning of a token
93-
if (surroundingSpacesIgnored) {
93+
if (ignoreSurroundingSpaces) {
9494
while (isWhitespace(c) && !eol) {
9595
c = in.read();
9696
eol = isEndOfLine(c);
@@ -163,7 +163,7 @@ private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
163163
}
164164
}
165165

166-
if (surroundingSpacesIgnored) {
166+
if (ignoreSurroundingSpaces) {
167167
trimTrailingSpaces(tkn.content);
168168
}
169169

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class Lexer {
3737
private final Character encapsulator;
3838
private final Character commmentStart;
3939

40-
final boolean surroundingSpacesIgnored;
40+
final boolean ignoreSurroundingSpaces;
4141
final boolean emptyLinesIgnored;
4242

4343
final CSVFormat format;
@@ -52,7 +52,7 @@ abstract class Lexer {
5252
this.escape = format.getEscape();
5353
this.encapsulator = format.getEncapsulator();
5454
this.commmentStart = format.getCommentStart();
55-
this.surroundingSpacesIgnored = format.getIgnoreSurroundingSpaces();
55+
this.ignoreSurroundingSpaces = format.getIgnoreSurroundingSpaces();
5656
this.emptyLinesIgnored = format.getIgnoreEmptyLines();
5757
}
5858

src/test/java/org/apache/commons/csv/CSVLexer1306663.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Token nextToken(final Token tkn) throws IOException {
9090
// important: make sure a new char gets consumed in each iteration
9191
while (tkn.type == INVALID) {
9292
// ignore whitespaces at beginning of a token
93-
if (surroundingSpacesIgnored) {
93+
if (ignoreSurroundingSpaces) {
9494
while (isWhitespace(c) && !eol) {
9595
c = in.read();
9696
eol = isEndOfLine(c);
@@ -161,7 +161,7 @@ private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
161161
}
162162
}
163163

164-
if (surroundingSpacesIgnored) {
164+
if (ignoreSurroundingSpaces) {
165165
trimTrailingSpaces(tkn.content);
166166
}
167167

src/test/java/org/apache/commons/csv/CSVLexer1306667.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Token nextToken(final Token tkn) throws IOException {
9090
// important: make sure a new char gets consumed in each iteration
9191
while (tkn.type == INVALID) {
9292
// ignore whitespaces at beginning of a token
93-
if (surroundingSpacesIgnored) {
93+
if (ignoreSurroundingSpaces) {
9494
while (isWhitespace(c) && !eol) {
9595
c = in.read();
9696
eol = isEndOfLine(c);
@@ -161,7 +161,7 @@ private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
161161
}
162162
}
163163

164-
if (surroundingSpacesIgnored) {
164+
if (ignoreSurroundingSpaces) {
165165
trimTrailingSpaces(tkn.content);
166166
}
167167

src/test/java/org/apache/commons/csv/CSVLexer3.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Token nextToken(final Token tkn) throws IOException {
133133
state = State.PLAIN;
134134
break;
135135
case WHITESPACE:
136-
if (!surroundingSpacesIgnored){
136+
if (!ignoreSurroundingSpaces){
137137
tkn.content.append((char) intch);
138138
state = State.PLAIN;
139139
}
@@ -155,7 +155,7 @@ Token nextToken(final Token tkn) throws IOException {
155155
state = State.ESCAPE_PLAIN;
156156
break;
157157
default:
158-
trimTrailingSpaces = surroundingSpacesIgnored; // we have a plain token
158+
trimTrailingSpaces = ignoreSurroundingSpaces; // we have a plain token
159159
tkn.content.append((char) intch);
160160
break;
161161
}
@@ -191,7 +191,7 @@ Token nextToken(final Token tkn) throws IOException {
191191
state = State.INQUOTE;
192192
break;
193193
case WHITESPACE: // trailing whitespace may be allowed
194-
if (!surroundingSpacesIgnored) {
194+
if (!ignoreSurroundingSpaces) {
195195
// error invalid char between token and next delimiter
196196
throw new IOException("(line " + getLineNumber() + ") invalid char between encapsulated token and delimiter");
197197
}

0 commit comments

Comments
 (0)