Skip to content

Commit 6fd5179

Browse files
author
Gary Gregory
committed
[CSV-239] Cannot get headers in column order from CSVRecord.
Rename CSVRecord.getCSVParser() -> getParser().
1 parent d346048 commit 6fd5179

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ public String get(final int i) {
7979
return values[i];
8080
}
8181

82-
private Map<String, Integer> getHeaderMapRaw() {
83-
return parser.getHeaderMapRaw();
84-
}
85-
8682
/**
8783
* Returns a value by name.
8884
*
@@ -138,13 +134,17 @@ public String getComment() {
138134
return comment;
139135
}
140136

137+
private Map<String, Integer> getHeaderMapRaw() {
138+
return parser.getHeaderMapRaw();
139+
}
140+
141141
/**
142142
* Returns the parser.
143143
*
144144
* @return the parser.
145145
* @since 1.7
146146
*/
147-
public CSVParser getCSVParser() {
147+
public CSVParser getParser() {
148148
return parser;
149149
}
150150

src/test/java/org/apache/commons/csv/CSVRecordTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void testGetUnmappedPositiveInt() {
108108
public void testIsConsistent() {
109109
assertTrue(record.isConsistent());
110110
assertTrue(recordWithHeader.isConsistent());
111-
final Map<String, Integer> map = recordWithHeader.getCSVParser().getHeaderMap();
111+
final Map<String, Integer> map = recordWithHeader.getParser().getHeaderMap();
112112
map.put("fourth", Integer.valueOf(4));
113113
// We are working on a copy of the map, so the record should still be OK.
114114
assertTrue(recordWithHeader.isConsistent());

0 commit comments

Comments
 (0)