Skip to content

Annotation @CsvCell(required = false) does not work with empty Number fields #76

Description

@bertrik

I have a CSV with number fields that are not always filled (converted from an XLS with merged cells). I've annotated this field as follows in the bean:
@CsvCell(required = false)
private Integer memoryAddress;
yet when I try to read the CSV with an empty cell for this field, I get a CsvException saying:
"Problem converting cell index 13 (M) [] to memoryAddress: java.lang.Number"

So it seems the "required" property of the @CsvCell annotation does not work for Integers, apparently only for Strings. Instead of the exception I expected this field would just simply be null in the bean and not cause an exception because of the "required=false" annotation.

version info: 'org.csveed:csveed:0.4.2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions