Rename to avoid hiding class field

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1304097 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-03-22 22:16:01 +00:00
parent dd26201ac4
commit 43987a7d78
1 changed files with 7 additions and 8 deletions

View File

@ -119,16 +119,15 @@ public class CSVParser implements Iterable<CSVRecord> {
*/
public List<CSVRecord> getRecords() throws IOException {
List<CSVRecord> records = new ArrayList<CSVRecord>();
CSVRecord record;
while ((record = getRecord()) != null) {
records.add(record);
CSVRecord rec;
while ((rec = getRecord()) != null) {
records.add(rec);
}
if (!records.isEmpty()) {
return records;
} else {
return null;
}
return null;
}
/**
@ -179,9 +178,9 @@ public class CSVParser implements Iterable<CSVRecord> {
String[] header = null;
if (format.getHeader().length == 0) {
// read the header from the first line of the file
CSVRecord record = getRecord();
if (record != null) {
header = record.values();
CSVRecord rec = getRecord();
if (rec != null) {
header = rec.values();
}
} else {
header = format.getHeader();