Was the Assert.notNull check in RecordFieldSetMapper (mapFieldSet) intentionally added for types where null is a valid value? #5387
Unanswered
ahmad-abed-alhamid
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
After migrating to Spring Batch 6.0.3, we noticed that
RecordFieldSetMapperno longer acceptsnullvalues for types where null is a valid value (Long,Integer, etc.).When reading a CSV where a field is empty/blank, e.g.
" ", theSimpleTypeConvertercorrectly converts it tonullforLong. But theAssert.notNulladded in commit62c4cbfrejects this value, causing anIllegalArgumentException.In Spring Batch 5,
nullwas accepted for these types and this worked correctly.Was this change intentional? For primitive types, rejecting
nullmakes sense, but for types where null is a valid value, this causes valid data to be rejected. Should I create an issue for this with a proper example?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions