Uploaded image for project: 'Johnzon'
  1. Johnzon
  2. JOHNZON-110

Support for large integrals

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.5
    • 1.1.0
    • 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

      https://java.net/projects/jsonp/sources/git/content/impl/src/main/java/org/glassfish/json/JsonNumberImpl.java?rev=de226229bd4bfab4aa87c11cab2f54efc50dffcb

      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

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            vivodamichele@hotmail.com Michele Vivoda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: