Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-881

NumberUtils.createNumber() Javadoc says it does not work for octal numbers

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.2
    • Component/s: lang.math.*
    • Labels:
      None

      Description

      The javadoc for NumberUtils.createNumber() states:

      "Values with leading 0's will not be interpreted as octal."

      However,

      assertEquals(25, NumberUtils.createNumber("0025"));

      fails, because NumberUtils.createNumber("0025") returns 21.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              michielgk Michiel Kalkman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: