commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-992) NumberUtils#isNumber() returns false for "0.0", "0.4790", et al
Date Thu, 27 Mar 2014 01:50:15 GMT

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

Niall Pemberton updated LANG-992:
---------------------------------

    Attachment: LANG-992.patch

Yes, this was caused by the second commit for LANG-972  in revision 1566967 when the change
for Octal numbers was made. I have a patch that resolves this specific issue, but perhaps
the Octal change should be reverted.

> NumberUtils#isNumber() returns false for "0.0", "0.4790", et al
> ---------------------------------------------------------------
>
>                 Key: LANG-992
>                 URL: https://issues.apache.org/jira/browse/LANG-992
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.3.1
>         Environment: Java 8, Windows 7
>            Reporter: Adam Rauch
>         Attachments: LANG-992.patch
>
>
> After upgraded from 3.1 to 3.3.1 it seems that isNumber(String str) returns false for
decimal numbers with leading zeros. In other words:
>    boolean ret = NumberUtils.isNumber("0.4790");
> On 3.1, ret was true. In 3.3.1, ret is false.
> Guessing that LANG-972 is related... comment in the code states:
> 	// leading 0, but not hex, must be octal
> This is clearly a case where leading 0 does not mean hex.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message