You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/02/19 17:14:00 UTC
[jira] [Resolved] (CSV-264) Duplicate empty header names are allowed even with `.withAllowDuplicateHeaderNames(false)`
[ https://issues.apache.org/jira/browse/CSV-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory resolved CSV-264.
---------------------------------
Fix Version/s: 1.10.0
Resolution: Fixed
In git master, please verify and close.
> Duplicate empty header names are allowed even with `.withAllowDuplicateHeaderNames(false)`
> ------------------------------------------------------------------------------------------
>
> Key: CSV-264
> URL: https://issues.apache.org/jira/browse/CSV-264
> Project: Commons CSV
> Issue Type: Bug
> Components: Parser
> Affects Versions: 1.8
> Reporter: Sagar Tiwari
> Priority: Major
> Fix For: 1.10.0
>
> Time Spent: 4.5h
> Remaining Estimate: 0h
>
> I'm trying to parse to parse a csv like this:
>
> {{CSVFormat.DEFAULT}}
> {{ .withHeader()}}
> {{ .withAllowDuplicateHeaderNames(false)}}
> {{ .withAllowMissingColumnNames()}}
> {{ .parse(InputStreamReader(FileInputStream(fl)))}}
>
> One would expect this code to throw an error if the following csv is given as input:
>
>
> {{"","a",""}}
> {{"1","X","3"}}
> {{"3","Y","4"}}
>
> But it doesn't, and asking for `record.get("")` gives the value from the second column. The first column is ignored.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)