Commit 9c0d607
committed
fix: reset() in StrictCsvParser left parser-state fields stale
reset() restored only startingLineNumber and the buffer, but not
lines, status, or finished. IndexedCsvReader.readPage() calls
reset() before each page; the leaked state then corrupted the
next page's results:
- A previous page that ended on a multi-line quoted record
left lines >= 2. The next page's parse() did
startingLineNumber += lines, reporting subsequent records
on the wrong line number (regression-tested).
- A previous page that exhausted its data set finished = true.
A later readPage() on the same reader then returned an empty
list because parse() short-circuited on the leaked finished
(regression-tested).
Also reset status to STATUS_RESET so reset() truly restores the
initial parser state rather than partially.1 parent 0819c4f commit 9c0d607
2 files changed
Lines changed: 37 additions & 0 deletions
File tree
- lib/src
- intTest/java/blackbox/reader
- main/java/de/siegmar/fastcsv/reader
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
113 | 147 | | |
114 | 148 | | |
115 | 149 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
348 | 351 | | |
349 | 352 | | |
350 | 353 | | |
| |||
0 commit comments