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

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

Rupert Wood created CSV-111:
-------------------------------

             Summary: 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


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)