Jörg Schaible resolved Bug XSTR-541 as Fixed

There is actually no easy answer to this. The JSON specification itself refers only the _javascript_ specification as base. I am quite sure that there are a lot Java (and _javascript_) programmers that are not aware that _javascript_ uses 64-bit double precision values only and that it is not possible to map the complete range of a 64-bit integer. Any integer value greater than 2^53 or lower than -2^53 can actually no longer be represented in JSON without a possible interoperability problem.

XStream supports currently two JSON implementations writing JSON, a native one and Jettison version 1.2.

For Jettison it is possible to set an alternative TypeConverter, e.g. Jettison's simple converter will write any value as String. Even Jettison's default converter supports a system property jettison.mapped.typeconverter.enforce_32bit_integer to write only 32-bit integer values as numbers and bigger ones as strings.

XStream's JsonWriter has now a new mode IEEE_754_MODE to write any 64-bit integer that exceeds the range mentioned above as string.

However, anything works as expected, if client and server use JSON implementations that can and will represent 64-bit integer values. Therefore the conversion of big 64-bit integers is not done by default.

Change By: Jörg Schaible (18/Sep/13 1:48 PM)
Resolution: Fixed
Fix Version/s: 1.x Maintenance
Status: Open Resolved
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to