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 2019/10/07 17:10:00 UTC

[jira] [Updated] (CSV-247) A single empty header is allowed when not allowing empty column headers.

     [ https://issues.apache.org/jira/browse/CSV-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated CSV-247:
--------------------------------
    Fix Version/s: 1.8

> A single empty header is allowed when not allowing empty column headers.
> ------------------------------------------------------------------------
>
>                 Key: CSV-247
>                 URL: https://issues.apache.org/jira/browse/CSV-247
>             Project: Commons CSV
>          Issue Type: Bug
>    Affects Versions: 1.7
>            Reporter: Alex Herbert
>            Priority: Minor
>             Fix For: 1.8
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> If the settings are not allowing empty columns headers you can currently use a single empty header. This is because column headers are only checked for empty when they are duplicates. So it is the second empty header (the first duplicate) that raises an error. This test should pass but does not:
> {code:java}
> @Test(expected = IllegalArgumentException.class)
> public void testHeadersMissingOneColumnException() throws Exception {
>     final Reader in = new StringReader("a,,c,d\n1,2,3,4\nx,y,z,zz");    CSVFormat.DEFAULT.withHeader().parse(in).iterator(); 
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)