Skip to content

Commit 4f61bd1

Browse files
committed
Extract check for metaChar
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1479706 13f79535-47bb-0310-9956-ffa450edef68
1 parent 883511f commit 4f61bd1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int readEscape() throws IOException {
108108
throw new IOException("EOF whilst processing escape sequence");
109109
default:
110110
// Now check for meta-characters
111-
if (isDelimiter(c) || isEscape(c) || isQuoteChar(c) || isCommentStart(c)) {
111+
if (isMetaChar(c)) {
112112
return c;
113113
}
114114
// indicate unexpected char - available from in.getLastChar()
@@ -181,4 +181,12 @@ boolean isQuoteChar(final int c) {
181181
boolean isCommentStart(final int c) {
182182
return c == commmentStart;
183183
}
184+
185+
private boolean isMetaChar(final int c) {
186+
return c == delimiter
187+
|| c == escape
188+
|| c == quoteChar
189+
|| c == commmentStart
190+
;
191+
}
184192
}

0 commit comments

Comments
 (0)