Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9.5
-
None
-
None
Description
While testing javax.json implementations I discovered Johnzon does not support very big integral numbers , they loose the value when converted to Long and might also become negative. Big decimals works fine.
Other implementations tested, the glassfish one and cookjson both support big integrals as java.math.BigInteger
I would suggest to test the length of an integral lexical without sign (being an integral has no decimals, no exponential part) , if is more than 18 digits, use java.math.BigInteger
See also the implementation of Glassfish
JsonTokenizer.isDefinitelyLong at https://java.net/projects/jsonp/sources/git/content/impl/src/main/java/org/glassfish/json/JsonTokenizer.java?rev=de226229bd4bfab4aa87c11cab2f54efc50dffcb
Regards,
Michele Vivoda