You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2014/08/14 22:08:23 UTC

[jira] [Closed] (CSV-111) CSVRecord.toMap() fails if row length shorter than header length

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

Benedikt Ritter closed CSV-111.
-------------------------------


> CSVRecord.toMap() fails if row length shorter than header length
> ----------------------------------------------------------------
>
>                 Key: CSV-111
>                 URL: https://issues.apache.org/jira/browse/CSV-111
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>            Reporter: Rupert Wood
>             Fix For: 1.0
>
>
> Similar to CSV-96, if .toMap() is called on a record that has fewer fields than we have header columns we'll get an ArrayOutOfBoundsException.
> {code}
> @Test
> public void testToMapWhenHeaderTooLong() throws Exception {
>    final CSVParser parser = new CSVParser("a,b", CSVFormat.newBuilder().withHeader("A", "B", "C").build());
>    final CSVRecord record = parser.iterator().next();
>    record.toMap();
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)