You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2006/12/19 22:46:22 UTC

[jira] Updated: (LANG-300) NumberUtils.createNumber throws NumberFormatException for one digit long

     [ http://issues.apache.org/jira/browse/LANG-300?page=all ]

Henri Yandell updated LANG-300:
-------------------------------

    Attachment: LANG-300.patch

Merging the third and fourth parts of that if statement together seems to solve the problem.

Unit test and patch attached.

> NumberUtils.createNumber throws NumberFormatException for one digit long
> ------------------------------------------------------------------------
>
>                 Key: LANG-300
>                 URL: http://issues.apache.org/jira/browse/LANG-300
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Jeremy Lemaire
>         Attachments: LANG-300.patch
>
>
> NumberUtils.createNumber throws a NumberFormatException when parsing "1l", "2l" .. etc...
> It works fine if you try to parse "01l" or "02l".  The condition isDigits(numeric.substring(1)), line 455 return false as numeric.substring(1) is an empty string for "1l"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org