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

Henri Yandell closed LANG-664.
------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0

Thanks - that's exactly the fix I applied :)

svn ci -m "Fixing NumberUtils.isNumber so that 1.1L is not considered a number. 
LANG-664"
Sending        src/main/java/org/apache/commons/lang3/math/NumberUtils.java
Sending        src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
Transmitting file data ..
Committed revision 1054202.

> NumberUtils.isNumber(String)  is not right when the String is "1.1L"
> --------------------------------------------------------------------
>
>                 Key: LANG-664
>                 URL: https://issues.apache.org/jira/browse/LANG-664
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>            Reporter: 雷钦
>             Fix For: 3.0
>
>
> "1.1L"  is not a Java Number . but NumberUtils.isNumber(String) return true.
> perhaps change:
> {code:java}
>             if (chars[i] == 'l'
>                 || chars[i] == 'L') {
>                 // not allowing L with an exponent
>                 return foundDigit && !hasExp;
>             }
> {code}
> to:
> {code:java}
>             if (chars[i] == 'l'
>                 || chars[i] == 'L') {
>                 // not allowing L with an exponent
>                 return foundDigit && !hasExp && !hasDecPoint;
>             }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to