Affects Version/s: 1.0
Fix Version/s: 1.1
Environment:Java 5; xstream 1.2.2; junit 1.3.8
Number of attachments :
A string value containing only decimal digits is serialized as integer value.
The problem with this is that in some cases some characters of string values are not serialized to JSON. Leading zero's of a string value containing only decimal digits are not serialized, for instance.
In version 1.0-RC1 of Jettison an instance of a class having a member variable (svalue in this example) of type String with a value of "00001234" was serialized as follows:
In version 1.0 of Jettison the an instance of the same class holding the same value is serialized as follows:
Note that the leading zero's are lost in the latest version. In my case the leading zero's are important as the string holds a reference to an entity in an external system.
A JUnit test (xstream based) for this case is attached.