commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (Commented) (JIRA)" <>
Subject [jira] [Commented] (CSV-82) CSVRecord inconsistent behaviour when header mapping is not found
Date Mon, 26 Mar 2012 14:44:28 GMT


Emmanuel Bourg commented on CSV-82:

The header line should indeed identify all the columns of the file, but the parsing code might
be ready to handle more columns than actually present.

I have a case where a file contains a date and a time column. The file is generated by a servlet,
and depending on a query parameter the time column might be omitted. There is a unique parsing
code for both cases, this code considers the time information as optional. It fetches the
time column by name and simply ignores a null value.

> CSVRecord inconsistent behaviour when header mapping is not found
> -----------------------------------------------------------------
>                 Key: CSV-82
>                 URL:
>             Project: Commons CSV
>          Issue Type: Bug
>            Reporter: Sebb
> The CSVRecord#get(String) method has inconsistent behaviour.
> If no header mapping was provided, then it throws IllegalStateException.
> If the header name is not found, null is returned.
> Apart from being inconsistent, it might be useful in the future to be able to return
null as a column value (as distinct from the empty string).
> It should throw IllegalArgumentException for a missing header name, instead of returning

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message