commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Honton (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LANG-1205) NumberUtils.createNumber() behaves inconsistently with NumberUtils.isNumber()
Date Sun, 24 Apr 2016 03:38:12 GMT

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

Charles Honton resolved LANG-1205.
----------------------------------
    Resolution: Fixed

commit b877fb9abef4a19eec9cc7329acbd433648b8f7b

> 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
>            Assignee: Charles Honton
>
> 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