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

NumberUtils.createNumber throws NumberFormatException for one digit long

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.3
    • None
    • None

    Description

      NumberUtils.createNumber throws a NumberFormatException when parsing "1l", "2l" .. etc...

      It works fine if you try to parse "01l" or "02l". The condition isDigits(numeric.substring(1)), line 455 return false as numeric.substring(1) is an empty string for "1l"

      Attachments

        1. LANG-300.patch
          1 kB
          Henri Yandell

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jeremy.lemaire Jeremy Lemaire
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: