Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bertrik opened this issue Oct 3, 2016 · 0 comments

Comments

@bertrik
Copy link

bertrik commented Oct 3, 2016

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant