Affects Version/s: 2.2.6
Fix Version/s: None
Any Java enviroment (seen on Windows and RHEL)
With JAXB 2.0, you can set an EventHandler to inform JAXB whether or not to continue processing whenever it detects an error. However, the current implementation fails to properly generate this event on several occasions, amongst others:
- A given string is not correctly mapped to an enum value, as described here:
- An xs:int that gets an integer out of bounds (for instance Integer.MAX_VALUE+1L)
- An xs:short that gets a short out of bounds (for instance Short.MAX_VALUE+1L)
- A boolean value that are not within the specification allowed values ("0", "1", "true", "false")
While these errors perhaps should not stop the continued JAXB processing per se, the event should be generated and the event handler should be able to decide whether or not the processing should stop (as its documentation states).
I have some test cases and made some changes to the JAXB classes, so the fix is fairly trivial (and in some cases, for instance in DatatypeConverterImpl, the exceptions were already there, just commented out - was this from 1.0, before the ValidationEvent were introduced?)
Would like to share the changes with you if I can get git access.