Handling of null/empty values could be improved
hvennekate opened this issue · comments
hvennekate commented
This choice appears unreasonable from the user's perspective: it is not possible to customize the behavior as the converter does not get called. At the same time, any previously initialized value gets overwritten.
Please either do not touch the existing value (from field initialization) or offer some hook into this process such that null
and empty values can be mapped to some reasonable default.
Jeremy Landis commented
@hvennekate Know this is old but are you saying it should be something like this?
Current
writeMethod.invoke(bean, value == null || value.equals("") ? null : converter.fromString(value));
New
writeMethod.invoke(bean, converter.fromString(value));