Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/main/java/org/apache/commons/csv/Lexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,6 @@ boolean isStartOfLine(final int ch) {
return ch == LF || ch == CR || ch == UNDEFINED;
}

/**
* Tests if the given char is a whitespace character.
*
* @return true if the given char is a whitespace character.
* @throws IOException If an I/O error occurs.
*/
boolean isWhitespace(final int ch) throws IOException {
return !isDelimiter(ch) && Character.isWhitespace((char) ch);
}

private char mapNullToDisabled(final Character c) {
return c == null ? DISABLED : c.charValue();
}
Expand Down Expand Up @@ -271,7 +261,7 @@ Token nextToken(final Token token) throws IOException {
while (token.type == INVALID) {
// ignore whitespaces at beginning of a token
if (ignoreSurroundingSpaces) {
while (isWhitespace(c) && !eol) {
while (Character.isWhitespace((char)c) && !isDelimiter(c) && !eol) {
c = reader.read();
eol = readEndOfLine(c);
}
Expand Down Expand Up @@ -364,7 +354,7 @@ private Token parseEncapsulatedToken(final Token token) throws IOException {
token.type = EORECORD;
return token;
}
if (!isWhitespace(c)) {
if (!Character.isWhitespace((char)c)) {
// error invalid char between token and next delimiter
throw new IOException("(line " + getCurrentLineNumber() +
") invalid char between encapsulated token and delimiter");
Expand Down