File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -734,9 +734,16 @@ 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+ * 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
745+ * {@link getRecords()}, and return an iterator to that list.
746+ * </p>
740747 */
741748 @ Override
742749 public Iterator <CSVRecord > iterator () {
@@ -799,7 +806,10 @@ CSVRecord nextRecord() throws IOException {
799806
800807 /**
801808 * Returns a sequential {@code Stream} with this collection as its source.
802- *
809+ * <p>
810+ * If the parser is closed, the stream will not produce any more values.
811+ * See the comments in {@link iterator()}.
812+ * </p>
803813 * @return a sequential {@code Stream} with this collection as its source.
804814 * @since 1.9.0
805815 */
You can’t perform that action at this time.
0 commit comments