Stephan Knitelius created LANG-968:
--------------------------------------

             Summary: NumberUtils#createInteger NFE with multiple leading zeros
                 Key: LANG-968
                 URL: https://issues.apache.org/jira/browse/LANG-968
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.math.*
    Affects Versions: 3.2.1
            Reporter: Stephan Knitelius
            Priority: Minor


When trying to convert the String "0085" to an Integer I get the following 
numberFormatException:

java.lang.NumberFormatException: For input string: "085"

Looking at the code reveals that only a null check is preformed before 
delegating to Integer#decode.

It would be nice if the NumberUtil classes create* Methods would offer some 
more support:

- remove leading and traling spaces.
- remove leading zeros.






--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to