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

Decimal128 throws AssertionError instead of NumberFormatException

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      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:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            asereda Andrei Sereda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: