Details
-
Type: Bug
-
Status: Closed
-
Priority: Critical
-
Resolution: Won't Fix
-
Affects Version/s: 1.3.1
-
Fix Version/s: None
-
Component/s: Converters
-
Labels:None
Description
For following XML mapped to User class with fields email (string) and dob (Date)
<User><email></email><dob></dob></User>
DateConvertor throws error because, it is trying to parse empty string.
DateConvertor should be able to handle this by simply returning null (instead of throwing exception)
Sorry, null is not represented by an empty tag. If a field is null it is not part of the XML structure. An empty string is not a proper date format and you are feeding the converter with undefined data. You argue that you will have a null value returned instead, the next would like to have 1st January 1970 and another one prefers an exception. Therefore you have to handle this case with a customized verison of the DateConverter yourself.