Skip to content

Commit fcfb6dc

Browse files
committed
CSV-84 Clarify comment handling
Test was wrong; line comment should have been dropped entirely. Fix record handling accordingly git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306342 13f79535-47bb-0310-9956-ffa450edef68
1 parent e922bf9 commit fcfb6dc

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ CSVRecord getRecord() throws IOException {
155155
case INVALID:
156156
throw new IOException("(line " + getLineNumber() + ") invalid parse sequence");
157157
case COMMENT: // Ignored currently
158+
reusableToken.type = TOKEN; // Read another token
158159
break;
159160
}
160161
} while (reusableToken.type == TOKEN);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ public void testDefaultFormat() throws IOException {
352352
String[][] res_comments = {
353353
{"a", "b"},
354354
{"\n", " "},
355-
{},
356355
};
357356

358357
format = CSVFormat.DEFAULT.withCommentStart('#');

0 commit comments

Comments
 (0)