uniVocity-parsers is a suite of extremely fast and reliable parsers for Java. It provides a consistent interface for handling different file formats, and a solid framework for the development of new parsers.
It seems that handleConversionError throws an ArrayIndexOutOfBoundsException, when a CSV file contains only one field without commas in a record while the header have seviral columns.
The row[2] fails because of that:
Input CSV:
LastName, FirstName, Number, Date
Johnson, James, 00000, 2022-7-26
Smith
Messages:
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at com.univocity.parsers.common.DefaultConversionProcessor.handleConversionError(DefaultConversionProcessor.java:284)
at com.univocity.parsers.common.DefaultConversionProcessor.validateAllValues(DefaultConversionProcessor.java:173)
at com.univocity.parsers.common.DefaultConversionProcessor.applyConversions(DefaultConversionProcessor.java:132)
at com.univocity.parsers.common.processor.core.BeanConversionProcessor.createBean(BeanConversionProcessor.java:663)
at com.univocity.parsers.common.processor.core.AbstractBeanProcessor.rowProcessed(AbstractBeanProcessor.java:54)
at com.univocity.parsers.common.Internal.process(Internal.java:30)
... 62 common frames omitted
ExceptionHandlerExceptionResolver - Resolved [com.univocity.parsers.common.DataProcessingException:
Unexpected error processing input row [Smith] using Processor com.univocity.parsers.common.processor.BeanListProcessor.
<EOL>Internal state when error was thrown: row=[Smith]] (AbstractHandlerExceptionResolver.java:208)
Original source: my app encounters an error when it processes row[column] = defaultValue;
Hello Univocity Team,
It seems that
handleConversionError
throws an ArrayIndexOutOfBoundsException, when a CSV file contains only one field without commas in a record while the header have seviral columns.The row[2] fails because of that:
Input CSV:
Messages:
Original source: my app encounters an error when it processes
row[column] = defaultValue;
univocity-parsers, version: 2.9.1
Thank you for your work on the excellent Univocity library.