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:18:00 UTC
[jira] [Resolved] (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 resolved LANG-1385.
--------------------------------
Resolution: Fixed
Assignee: Gary Gregory
Fix Version/s: 3.8
Thank you for your report [~rohanpadhye].
Fixed in git master. Please verify and close this ticket.
> 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
> Assignee: Gary Gregory
> Priority: Minor
> Fix For: 3.8
>
>
> 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)