Skip to content

Commit

Permalink
Rename a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sigee committed Sep 19, 2024
1 parent 8b23cbb commit 1eaceb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/apache/commons/csv/CSVParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,11 @@ private Map<String, Integer> createEmptyHeaderMap() {
* @throws CSVException Thrown on invalid input.
*/
private Headers createHeaders() throws IOException {
Map<String, Integer> hdrMap = null;
Map<String, Integer> headerMap = null;
List<String> headerNames = null;
final String[] formatHeader = format.getHeader();
if (formatHeader != null) {
hdrMap = createEmptyHeaderMap();
headerMap = createEmptyHeaderMap();
String[] headerRecord = null;
if (formatHeader.length == 0) {
// read the header from the first line of the file
Expand All @@ -504,10 +504,10 @@ private Headers createHeaders() throws IOException {
headerRecord = formatHeader;
}

headerNames = getHeaderNames(headerRecord, hdrMap);
headerNames = getHeaderNames(headerRecord, headerMap);
}
// Make header names Collection immutable
return new Headers(hdrMap, headerNames == null ? Collections.emptyList() : Collections.unmodifiableList(headerNames));
return new Headers(headerMap, headerNames == null ? Collections.emptyList() : Collections.unmodifiableList(headerNames));
}

/**
Expand Down

0 comments on commit 1eaceb1

Please sign in to comment.