-
Notifications
You must be signed in to change notification settings - Fork 30
Description
We are using castor-xml-1.3.2.jar for Xml data binding. In production we had an issue where the amount field which is of type BigDecimal, was getting swapped with other amount value from different xml document and thread at the time of un-marshalling. When we analyzed further we found the issue with PrimitiveObjectFactory class which internally has static Map of handlers to handle different data types. This handler is used to create the respective data type objects with the values passed from SAX parser. But the handler maintains a state with fields Class<?> type; String value; Object object; in PrimitiveObject class which is super class of all the handlers and which is not thread safe.
Earlier we thought that the issue is only for Big-Decimal but its is for any other data type as well.