commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (LANG-971) NumberUtils#isNumber(String) fails to evaluate invalid Octal numbers
Date Tue, 11 Feb 2014 02:33:19 GMT

     [ https://issues.apache.org/jira/browse/LANG-971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb updated LANG-971:
----------------------

    Comment: was deleted

(was: A related bug is that isNumber() does not allow for 0XABCD whereas createNumber() allows
for both 0xABCD and 0XABCD)

> NumberUtils#isNumber(String) fails to evaluate 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
>
> 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)

Mime
View raw message