You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "yusw (JIRA)" <ji...@apache.org> on 2017/09/19 13:23:00 UTC
[jira] [Commented] (LANG-1353) NumberUtils.isNumber bug
[ https://issues.apache.org/jira/browse/LANG-1353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171670#comment-16171670 ]
yusw commented on LANG-1353:
----------------------------
This is a trap, if you do not see the specific implementation of the method, who do not know will be treated as octal. I do not think it's a good practice.
> NumberUtils.isNumber bug
> ------------------------
>
> Key: LANG-1353
> URL: https://issues.apache.org/jira/browse/LANG-1353
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.math.*
> Affects Versions: 3.6
> Reporter: yusw
> Priority: Critical
> Fix For: 3.7
>
>
> hi,I used to NumberUtils.isNumber()[version:3.6] find this error, this error is mainly caused by method isCreatable() in the 723 line of code。
> See below for details:
> String str = "0927";
> System.out.println(NumberUtils.isNumber(str));
> {color:red}//result:false{color}
> String str1 = "9027";
> System.out.println(NumberUtils.isNumber(str1));
> //result:true
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)