Long.fromString coerces valid inputs to 'Long.ZERO'

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • bson-6.7.0
    • Affects Version/s: None
    • Component/s: None
    • 2
    • Not Needed
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a... BSON user
      I want... valid numeric inputs to Long.fromString to not be coerced
      So that... my data isn't corrupted

      Acceptance Criteria

      Implementation Requirements

      • when radix is >=24, and input is 'NaN' return numeric value
        • ex: in radix 26, 'NaN' represents 17060 in decimal
      • when radix is >=35 and input is '+Infinity', '-Infinity', or 'Infinity', return numeric value
      • otherwise with 'NaN', '+Infinity', '-Infinity', or 'Infinity' inputs, coerce to Long.ZERO

      Testing Requirements

      • add unit tests for +Infinity, -Infinity, Infinity, with radixes <35 and >=35
      • add unit tests for NaN, with radixes < 24 and >=24 

            Assignee:
            Aditi Khare (Inactive)
            Reporter:
            Aditi Khare (Inactive)
            Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: