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)

Reply via email to