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

NumberUtils.createNumber() throws StringIndexOutOfBoundsException instead of NumberFormatException

    XMLWordPrintableJSON

    Details

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

      Description

      Test case:

      NumberUtils.createNumber("L")

      Expected: NumberFormatException

      Got:

      java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(String.java:658)
       at org.apache.commons.lang3.math.NumberUtils.createNumber(NumberUtils.java:528)
      

       

       

        Attachments

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              rohanpadhye Rohan Padhye
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: