File tree Expand file tree Collapse file tree
main/java/org/apache/commons/csv
test/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,26 +324,8 @@ public long getRecordNumber() {
324324 * on parse error or input read-failure
325325 */
326326 public List <CSVRecord > getRecords () throws IOException {
327- return getRecords (new ArrayList <CSVRecord >());
328- }
329-
330- /**
331- * Parses the CSV input according to the given format and adds the content to the collection of {@link CSVRecord
332- * CSVRecords}.
333- *
334- * <p>
335- * The returned content starts at the current parse-position in the stream.
336- * </p>
337- *
338- * @param records
339- * The collection to add to.
340- * @param <T> the type of collection used.
341- * @return a collection of {@link CSVRecord CSVRecords}, may be empty
342- * @throws IOException
343- * on parse error or input read-failure
344- */
345- public <T extends Collection <CSVRecord >> T getRecords (final T records ) throws IOException {
346327 CSVRecord rec ;
328+ List <CSVRecord > records = new ArrayList <>();
347329 while ((rec = this .nextRecord ()) != null ) {
348330 records .add (rec );
349331 }
Original file line number Diff line number Diff line change @@ -531,14 +531,6 @@ public void testGetOneLine() throws IOException {
531531 parser .close ();
532532 }
533533
534- @ Test
535- public void testGetOneLineCustomCollection () throws IOException {
536- final CSVParser parser = CSVParser .parse (CSV_INPUT_1 , CSVFormat .DEFAULT );
537- final CSVRecord record = parser .getRecords (new LinkedList <CSVRecord >()).getFirst ();
538- assertArrayEquals (RESULT [0 ], record .values ());
539- parser .close ();
540- }
541-
542534 /**
543535 * Tests reusing a parser to process new string records one at a time as they are being discovered. See [CSV-110].
544536 *
You can’t perform that action at this time.
0 commit comments