Skip to content

Commit 1da5a8b

Browse files
committed
Fix typo, extract getHeaderMapRaw to var
1 parent 0d4bcdb commit 1da5a8b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public String get(final int i) {
8888
}
8989

9090
/**
91-
* Returns a value by name. If multiple instances of the header name exists, only the last occurence is returned.
91+
* Returns a value by name. If multiple instances of the header name exists, only the last occurrence is returned.
9292
*
9393
* <p>
9494
* Note: This requires a field mapping obtained from the original parser.
@@ -267,10 +267,11 @@ public Iterator<String> iterator() {
267267
* @since 1.9.0
268268
*/
269269
public <M extends Map<String, String>> M putIn(final M map) {
270-
if (getHeaderMapRaw() == null) {
270+
final Map<String, Integer> rawHeaderMap = getHeaderMapRaw();
271+
if (rawHeaderMap == null) {
271272
return map;
272273
}
273-
getHeaderMapRaw().forEach((key, value) -> {
274+
rawHeaderMap.forEach((key, value) -> {
274275
if (value < values.length) {
275276
map.put(key, values[value]);
276277
}
@@ -312,7 +313,7 @@ public List<String> toList() {
312313

313314
/**
314315
* Copies this record into a new Map of header name to record value. If multiple instances of a header name exists,
315-
* only the last occurence is mapped.
316+
* only the last occurrence is mapped.
316317
*
317318
* <p>
318319
* Editing the map does not update this instance.

0 commit comments

Comments
 (0)