You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/03/27 02:42:23 UTC
svn commit: r1305692 -
/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
Author: sebb
Date: Tue Mar 27 00:42:22 2012
New Revision: 1305692
URL: http://svn.apache.org/viewvc?rev=1305692&view=rev
Log:
CSV-87 CSVParser.getRecords() returns null rather than empty List at EOF
Modified:
commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java?rev=1305692&r1=1305691&r2=1305692&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java Tue Mar 27 00:42:22 2012
@@ -110,11 +110,11 @@ public class CSVParser implements Iterab
/**
* Parses the CSV input according to the given format and returns the content
- * as an array of records (whereas records are arrays of single values).
+ * as an array of {@link CSVRecord} entries.
* <p/>
* The returned content starts at the current parse-position in the stream.
*
- * @return matrix of records x values ('null' when end of file)
+ * @return list of {@link CSVRecord} entries, may be empty
* @throws IOException on parse error or input read-failure
*/
public List<CSVRecord> getRecords() throws IOException {
@@ -123,11 +123,7 @@ public class CSVParser implements Iterab
while ((rec = getRecord()) != null) {
records.add(rec);
}
-
- if (!records.isEmpty()) {
- return records;
- }
- return null;
+ return records;
}
/**