Skip to content

Commit 5fbd353

Browse files
authored
Update text as requested in review
1 parent 389cf00 commit 5fbd353

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -740,18 +740,10 @@ private boolean isStrictQuoteMode() {
740740
* {@link NoSuchElementException}.
741741
* </p>
742742
* <p>
743-
* For example, the iterator from code such as
744-
* <pre>
745-
* Iterator{@code<CSVRecord>} items() throws IOException {
746-
* try (CSVParser parser = CSVParser.parse( ... )) {
747-
* return parser.iterator();
748-
* }
749-
* }
750-
* </pre>
751-
* will never yield any records because the parser is closed by the
752-
* try-with-resources block.
753-
* An alternative is to extract all records as a list with
743+
* If it is necessary to construct an iterator which is usable after the
744+
* parser is closed, one option is to extract all records as a list with
754745
* {@link getRecords()}, and return an iterator to that list.
746+
* </p>
755747
*/
756748
@Override
757749
public Iterator<CSVRecord> iterator() {
@@ -817,6 +809,7 @@ CSVRecord nextRecord() throws IOException {
817809
* <p>
818810
* If the parser is closed, the stream will not produce any more values.
819811
* See the comments in {@link iterator()}.
812+
* </p>
820813
* @return a sequential {@code Stream} with this collection as its source.
821814
* @since 1.9.0
822815
*/

0 commit comments

Comments
 (0)