Skip to content

Commit 43987a7

Browse files
committed
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
1 parent dd26201 commit 43987a7

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,15 @@ public CSVParser(String input, CSVFormat format) throws IOException{
119119
*/
120120
public List<CSVRecord> getRecords() throws IOException {
121121
List<CSVRecord> records = new ArrayList<CSVRecord>();
122-
CSVRecord record;
123-
while ((record = getRecord()) != null) {
124-
records.add(record);
122+
CSVRecord rec;
123+
while ((rec = getRecord()) != null) {
124+
records.add(rec);
125125
}
126126

127127
if (!records.isEmpty()) {
128128
return records;
129-
} else {
130-
return null;
131129
}
130+
return null;
132131
}
133132

134133
/**
@@ -179,9 +178,9 @@ private Map<String, Integer> initializeHeader(CSVFormat format) throws IOExcepti
179178
String[] header = null;
180179
if (format.getHeader().length == 0) {
181180
// read the header from the first line of the file
182-
CSVRecord record = getRecord();
183-
if (record != null) {
184-
header = record.values();
181+
CSVRecord rec = getRecord();
182+
if (rec != null) {
183+
header = rec.values();
185184
}
186185
} else {
187186
header = format.getHeader();

0 commit comments

Comments
 (0)