Description
Given a parser format for csv files with a header line:
CSVFormat myFormat = CSVFormat.RFC4180.withDelimiter(",").withQuoteChar('"').withQuotePolicy(Quote.MINIMAL) .withIgnoreSurroundingSpaces(true).withHeader().withSkipHeaderRecord(true);
And given a file with duplicate header names:
Col1,Col2,Col2,Col3,Col4
1,2,3,4,5
4,5,6,7,8
The HeaderMap returned by the parser misses an entry because of the Column name being used as a key, leading to wrong behavior when we rely on it.
If this is not supposed to happen in the file regarding the CSV format, at least this should raise an error. If not we should come up with a more clever way to store and access the headers.
Attachments
Issue Links
- relates to
-
CSV-114 CSVFormat constructor should reject a header array with duplicate entries
- Closed