From 8fdcb3da115d1dcfe27f702b90195aa44beb1834 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Tue, 15 Jul 2014 17:42:06 +0000 Subject: [PATCH] Remove needless method git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1610769 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/csv/CSVParser.java | 20 +------------------ .../org/apache/commons/csv/CSVParserTest.java | 8 -------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 533fe291..69c9b73f 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -324,26 +324,8 @@ public final class CSVParser implements Iterable, Closeable { * on parse error or input read-failure */ public List getRecords() throws IOException { - return getRecords(new ArrayList()); - } - - /** - * Parses the CSV input according to the given format and adds the content to the collection of {@link CSVRecord - * CSVRecords}. - * - *

- * The returned content starts at the current parse-position in the stream. - *

- * - * @param records - * The collection to add to. - * @param the type of collection used. - * @return a collection of {@link CSVRecord CSVRecords}, may be empty - * @throws IOException - * on parse error or input read-failure - */ - public > T getRecords(final T records) throws IOException { CSVRecord rec; + List records = new ArrayList<>(); while ((rec = this.nextRecord()) != null) { records.add(rec); } diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java index 1d393897..91fe2646 100644 --- a/src/test/java/org/apache/commons/csv/CSVParserTest.java +++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java @@ -531,14 +531,6 @@ public class CSVParserTest { parser.close(); } - @Test - public void testGetOneLineCustomCollection() throws IOException { - final CSVParser parser = CSVParser.parse(CSV_INPUT_1, CSVFormat.DEFAULT); - final CSVRecord record = parser.getRecords(new LinkedList()).getFirst(); - assertArrayEquals(RESULT[0], record.values()); - parser.close(); - } - /** * Tests reusing a parser to process new string records one at a time as they are being discovered. See [CSV-110]. *