This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-csv.git


The following commit(s) were added to refs/heads/master by this push:
     new 26a8442e Better local variable name
26a8442e is described below

commit 26a8442e45ed2b55034ef96e9ccf152459977f58
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Mar 14 14:35:12 2025 -0400

    Better local variable name
---
 src/main/java/org/apache/commons/csv/CSVParser.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java 
b/src/main/java/org/apache/commons/csv/CSVParser.java
index 9cc73714..29e4bc73 100644
--- a/src/main/java/org/apache/commons/csv/CSVParser.java
+++ b/src/main/java/org/apache/commons/csv/CSVParser.java
@@ -602,11 +602,11 @@ public final class CSVParser implements 
Iterable<CSVRecord>, Closeable {
      * @throws CSVException 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
@@ -637,7 +637,7 @@ public final class CSVParser implements 
Iterable<CSVRecord>, Closeable {
                             "A header name is missing in " + 
Arrays.toString(headerRecord));
                     }
 
-                    final boolean containsHeader = blankHeader ? 
observedMissing : hdrMap.containsKey(header);
+                    final boolean containsHeader = blankHeader ? 
observedMissing : headerMap.containsKey(header);
                     final DuplicateHeaderMode headerMode = 
format.getDuplicateHeaderMode();
                     final boolean duplicatesAllowed = headerMode == 
DuplicateHeaderMode.ALLOW_ALL;
                     final boolean emptyDuplicatesAllowed = headerMode == 
DuplicateHeaderMode.ALLOW_EMPTY;
@@ -650,7 +650,7 @@ public final class CSVParser implements 
Iterable<CSVRecord>, Closeable {
                     }
                     observedMissing |= blankHeader;
                     if (header != null) {
-                        hdrMap.put(header, Integer.valueOf(i)); // Explicit 
(un)boxing is intentional
+                        headerMap.put(header, Integer.valueOf(i)); // Explicit 
(un)boxing is intentional
                         if (headerNames == null) {
                             headerNames = new ArrayList<>(headerRecord.length);
                         }
@@ -660,7 +660,7 @@ public final class CSVParser implements 
Iterable<CSVRecord>, Closeable {
             }
         }
         // 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));
     }
 
     /**

Reply via email to