@@ -734,9 +734,24 @@ private boolean isStrictQuoteMode() {
734734 * {@link IllegalStateException}.
735735 * </p>
736736 * <p>
737- * If the parser is closed a call to {@link Iterator#next()} will throw a
737+ * If the parser is closed, the iterator will not yield any more records.
738+ * A call to {@link Iterator#hasNext()} will return {@code false} and
739+ * a call to {@link Iterator#next()} will throw a
738740 * {@link NoSuchElementException}.
739741 * </p>
742+ * <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
754+ * {@link getRecords()}, and return an iterator to that list.
740755 */
741756 @ Override
742757 public Iterator <CSVRecord > iterator () {
@@ -799,7 +814,9 @@ CSVRecord nextRecord() throws IOException {
799814
800815 /**
801816 * Returns a sequential {@code Stream} with this collection as its source.
802- *
817+ * <p>
818+ * If the parser is closed, the stream will not produce any more values.
819+ * See the comments in {@link iterator()}.
803820 * @return a sequential {@code Stream} with this collection as its source.
804821 * @since 1.9.0
805822 */
0 commit comments