Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2982

Decimal128 is throwing AssertionError instead of NumberFormatException

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.8.1
    • Error Handling
    • None

    Description

      The method description states that NumberFormatException is thrown if value is out of the Decimal128 range:

      https://github.com/mongodb/mongo-java-driver/blob/r3.8.1/bson/src/main/org/bson/types/Decimal128.java#L105

      However, later on when it's checking for exponent is throwing AssertionError

      https://github.com/mongodb/mongo-java-driver/blob/r3.8.1/bson/src/main/org/bson/types/Decimal128.java#L174

      Need to throw NumberFormatException as similarly performed in clampAndRound() method ?

      https://github.com/mongodb/mongo-java-driver/blob/r3.8.1/bson/src/main/org/bson/types/Decimal128.java#L214

       

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            wan.bachtiar@mongodb.com Wan Bachtiar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: