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

NumberUtils#isNumber(String) fails to reject invalid Octal numbers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.1
    • 3.3
    • lang.math.*
    • None

    Description

      When trying to convert "0085" with NumberUtils.createInteger(String) an NumberFormatException is thrown.

      This is because the leading 0 causes the String to be evaluated as an Octal, 8 is not a valid octal.

      However NumberUtils#isNumber(String) evaluates to true, even so it cannot be converted.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sknitelius Stephan Knitelius
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: