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 @@ -732,7 +732,7 @@ Map<String, Integer> getHeaderMapRaw() {
732732 * @since 1.7
733733 */
734734 public List <String > getHeaderNames () {
735- return Collections . unmodifiableList ( headers .headerNames ) ;
735+ return headers .headerNames ;
736736 }
737737
738738 /**
@@ -765,7 +765,12 @@ public long getRecordNumber() {
765765 * on parse error or input read-failure
766766 */
767767 public List <CSVRecord > getRecords () {
768- return stream ().collect (Collectors .toList ());
768+ final List <CSVRecord > records = new ArrayList <>();
769+ final Iterator <CSVRecord > iterator = iterator ();
770+ while (iterator .hasNext ()) {
771+ records .add (iterator .next ());
772+ }
773+ return records ;
769774 }
770775
771776 /**
@@ -866,7 +871,7 @@ private boolean isStrictQuoteMode() {
866871 * {@link #getRecords()}, and return an iterator to that list.
867872 * </p>
868873 * <p>
869- * You can use {@link CSVFormat.Builder#setMaxRows(long)} to limit how many rows an Iterator produces.
874+ * You can use {@link CSVFormat.Builder#setMaxRows(long)} to limit how many rows this Iterator produces.
870875 * </p>
871876 */
872877 @ Override
You can’t perform that action at this time.
0 commit comments