Remove needless method
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1610769 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4623756644
commit
8fdcb3da11
|
@ -324,26 +324,8 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
|
||||||
* on parse error or input read-failure
|
* on parse error or input read-failure
|
||||||
*/
|
*/
|
||||||
public List<CSVRecord> getRecords() throws IOException {
|
public List<CSVRecord> getRecords() throws IOException {
|
||||||
return getRecords(new ArrayList<CSVRecord>());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses the CSV input according to the given format and adds the content to the collection of {@link CSVRecord
|
|
||||||
* CSVRecords}.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* The returned content starts at the current parse-position in the stream.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param records
|
|
||||||
* The collection to add to.
|
|
||||||
* @param <T> 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 extends Collection<CSVRecord>> T getRecords(final T records) throws IOException {
|
|
||||||
CSVRecord rec;
|
CSVRecord rec;
|
||||||
|
List<CSVRecord> records = new ArrayList<>();
|
||||||
while ((rec = this.nextRecord()) != null) {
|
while ((rec = this.nextRecord()) != null) {
|
||||||
records.add(rec);
|
records.add(rec);
|
||||||
}
|
}
|
||||||
|
|
|
@ -531,14 +531,6 @@ public class CSVParserTest {
|
||||||
parser.close();
|
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<CSVRecord>()).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].
|
* Tests reusing a parser to process new string records one at a time as they are being discovered. See [CSV-110].
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue