commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1205) NumberUtils.createNumber() behaves inconsistently with NumberUtils.isNumber()
Date Thu, 17 Mar 2016 14:27:33 GMT

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

ASF GitHub Bot commented on LANG-1205:
--------------------------------------

GitHub user pbrose opened a pull request:

    https://github.com/apache/commons-lang/pull/130

    [LANG-1205] NumberUtils.createNumber() behaves inconsistently with Nu…

    …mberUtils.isNumber()

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pbrose/commons-lang LANG-1205

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/130.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #130
    
----
commit 568b1ded1bb6c11bfcf4f86767b52fb4ee5e125b
Author: patrick.brose <patrick.brose@mailbox.tu-berlin.de>
Date:   2016-03-17T14:23:57Z

    [LANG-1205] NumberUtils.createNumber() behaves inconsistently with NumberUtils.isNumber()

----


> NumberUtils.createNumber() behaves inconsistently with NumberUtils.isNumber()
> -----------------------------------------------------------------------------
>
>                 Key: LANG-1205
>                 URL: https://issues.apache.org/jira/browse/LANG-1205
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.1
>            Reporter: Daniel Brown
>
> The {{NumberUtils.createNumber()}} method fails to check for multiple trailing characters,
and as a result, it returns a value even though {{NumberUtils.isNumber()}} indicates that
it should not.  For example:
> {code}
> boolean isNumber = NumberUtils.isNumber("81.5514DD");   // returns false
> Number numValue = NumberUtils.createNumber("81.5514DD");  // returns a Double value,
81.5514
> {code}
> I would expect the {{createNumber()}} method to throw a {{NumberFormatException}} in
this case.



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

Mime
View raw message