Skip to content

Commit 8fdcb3d

Browse files
committed
Remove needless method
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1610769 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4623756 commit 8fdcb3d

2 files changed

Lines changed: 1 addition & 27 deletions

File tree

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff 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
}

src/test/java/org/apache/commons/csv/CSVParserTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)