You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2014/02/11 03:55:19 UTC
[jira] [Resolved] (LANG-971) NumberUtils#isNumber(String) fails to
reject invalid Octal numbers
[ https://issues.apache.org/jira/browse/LANG-971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb resolved LANG-971.
-----------------------
Resolution: Fixed
Fix Version/s: 3.3
URL: http://svn.apache.org/r1566967
Log:
LANG-971 NumberUtils#isNumber(String) fails to reject invalid Octal numbers
Modified:
commons/proper/lang/trunk/src/changes/changes.xml
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
> NumberUtils#isNumber(String) fails to reject invalid Octal numbers
> ------------------------------------------------------------------
>
> Key: LANG-971
> URL: https://issues.apache.org/jira/browse/LANG-971
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.math.*
> Affects Versions: 3.2.1
> Reporter: Stephan Knitelius
> Priority: Minor
> Fix For: 3.3
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)