commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LANG-1216) NumberUtils.isNumber bug
Date Sat, 22 Oct 2016 12:31:59 GMT

    [ https://issues.apache.org/jira/browse/LANG-1216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15597781#comment-15597781
] 

Bruno P. Kinoshita edited comment on LANG-1216 at 10/22/16 12:31 PM:
---------------------------------------------------------------------

Just in case the code changes, here's the code aforementioned, on line 1370

https://github.com/apache/commons-lang/blob/91d6bd74fa358fdc8d7cb7681c76c509fd9a8e7d/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L1370

{code}
     * @param str  the <code>String</code> to check
     * @return <code>true</code> if the string is a correctly formatted number
     * @since 3.3 the code supports hex {@code 0Xhhh} an
-->*        octal {@code 0ddd} validation
     * @deprecated This feature will be removed in Lang 4.0,
     *             use {@link NumberUtils#isCreatable(String)} instead
     */
{code}

Tip: if you need to mention code and code lines in the ticket, it might be a good idea to
say what is the HEAD commit, so that if the code changes others can still work on the issue
later :-) Or just include the code in the ticket.


was (Author: kinow):
Just in case the code changes, here's the code aforementioned, on line 1370

https://github.com/apache/commons-lang/blob/91d6bd74fa358fdc8d7cb7681c76c509fd9a8e7d/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L1370

Tip: if you need to mention code and code lines in the ticket, it might be a good idea to
say what is the HEAD commit, so that if the code changes others can still work on the issue
later :-) Or just include the code in the ticket.

> NumberUtils.isNumber bug
> ------------------------
>
>                 Key: LANG-1216
>                 URL: https://issues.apache.org/jira/browse/LANG-1216
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.4
>            Reporter: yusw
>             Fix For: 3.5
>
>
> I found that when using NumberUtils【org.apache.commons.lang3.math.NumberUtils.isNumber(version3.4)】
isNumber method the following phenomenon, 
> when the parameter is 1.0 is true, but when the parameter is 0.1 is displayed is false.
> When I use 0.1 as the parameter tuning isNumber method, 
> view the source code in the method of the method of line 1370 discovered a problem.
> When the analytical parameter is ". ", this time the chars [I] value is 46, direct return
false.
> I think to do so is not very reasonable, please give me your guidance.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message