Decimal128 throws AssertionError instead of NumberFormatException

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      According to documentation NumberFormatException should be thrown when BigDecimal is out of range for Decimal128 but looking at the code AssertionError is being used instead :

      if ((exponent < MIN_EXPONENT) || (exponent > MAX_EXPONENT)) {
      throw new AssertionError("Exponent is out of range for Decimal128 encoding: " + exponent); 
      }
      

            Assignee:
            Jeffrey Yemin
            Reporter:
            Andrei Sereda
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: