Skip to content

Commit 3955709

Browse files
committed
fix only has string and delimiter
1 parent 4301775 commit 3955709

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

JavaCSV-Reloaded/src/com/csvreader/CsvReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ public boolean readRecord() throws IOException {
12381238
// check to see if we hit the end of the file
12391239
// without processing the current record
12401240

1241-
if (startedColumn || (delimiterLen = getColumnDelimiterLen(lastLetter)) != -1) {
1241+
if (startedColumn || delimiterLen != -1) {
12421242
if (delimiterLen != -1) {
12431243
endColumn(delimiterLen);
12441244
} else {
@@ -1272,7 +1272,7 @@ public boolean readRecord() throws IOException {
12721272
rawRecord = "";
12731273
}
12741274

1275-
return hasReadNextLine || columnsCount > 0;
1275+
return hasReadNextLine;
12761276
}
12771277

12781278
/**

JavaCSV-Reloaded/src/test/com/csvreader/AllTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,11 +2435,7 @@ public void test181() throws Exception {
24352435
reader.setDelimiters(Arrays.asList(",|=:"));
24362436

24372437
Assert.assertTrue(reader.readRecord());
2438-
// this is non-standard usage
2439-
// for strings as delimiter, we cannot check latest character is delimiter,
2440-
// but we know that is empty string after the latest letter,
2441-
// so we discard empty data
2442-
Assert.assertEquals(1, reader.getColumnCount());
2438+
Assert.assertEquals(2, reader.getColumnCount());
24432439
Assert.assertEquals("1", reader.get(0));
24442440

24452441
reader.close();

0 commit comments

Comments
 (0)