You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/03/11 01:16:00 UTC
[jira] [Updated] (LANG-1385) NumberUtils.createNumber() throws
StringIndexOutOfBoundsException instead of NumberFormatException
[ https://issues.apache.org/jira/browse/LANG-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Gregory updated LANG-1385:
-------------------------------
Summary: NumberUtils.createNumber() throws StringIndexOutOfBoundsException instead of NumberFormatException (was: StringIndexOutOfBoundsException in NumberUtils.createNumber)
> NumberUtils.createNumber() throws StringIndexOutOfBoundsException instead of NumberFormatException
> ---------------------------------------------------------------------------------------------------
>
> Key: LANG-1385
> URL: https://issues.apache.org/jira/browse/LANG-1385
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.math.*
> Affects Versions: 3.7
> Reporter: Rohan Padhye
> Priority: Minor
>
> Test case:
> {noformat}
> NumberUtils.createNumber("L"){noformat}
> Expected: {{NumberFormatException}}
> Got:
> {noformat}
> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
> at java.lang.String.charAt(String.java:658)
> at org.apache.commons.lang3.math.NumberUtils.createNumber(NumberUtils.java:528)
> {noformat}
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)