commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Created] (LANG-822) NumberUtils#createNumber - bad behaviour for leading "--"
Date Wed, 12 Sep 2012 21:23:08 GMT
Sebb created LANG-822:

             Summary: NumberUtils#createNumber - bad behaviour for leading "--"
                 Key: LANG-822
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.math.*
    Affects Versions: 3.1
            Reporter: Sebb

NumberUtils#createNumber checks for a leading "--" in the string, and returns null if found.
This is documented as a work round for a bug in BigDecimal.

Returning nulll is contrary to the Javadoc and the behaviour for other methods which would
throw NumberFormatException.

It's not clear whether the BigDecimal problem still exists with recent versions of Java. However,
if it does exist, then the check needs to be done for all invocations of BigDecimal, i.e.
needs to be moved to createBigDecimal.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message