You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2012/11/12 18:35:16 UTC

[jira] [Created] (LANG-854) NumberUtils#createNumber - does not allow for hex numbers to be larger than Long

Sebb created LANG-854:
-------------------------

             Summary: NumberUtils#createNumber - does not allow for hex numbers to be larger than Long
                 Key: LANG-854
                 URL: https://issues.apache.org/jira/browse/LANG-854
             Project: Commons Lang
          Issue Type: Improvement
            Reporter: Sebb


NumberUtils#createNumber allows non-hex integers to be Integer, Long or BigInteger, however hex integers are only allowed to be Integer or Long; anything longer than 16 hex digits currently causes a NumberFormatException.

It might be useful to allow longer hex numbers and convert them to BigInteger.

--
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: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-854) NumberUtils#createNumber - does not allow for hex numbers to be larger than Long

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495440#comment-13495440 ] 

Gary Gregory commented on LANG-854:
-----------------------------------

Sounds good. What about binary numbers?
                
> NumberUtils#createNumber - does not allow for hex numbers to be larger than Long
> --------------------------------------------------------------------------------
>
>                 Key: LANG-854
>                 URL: https://issues.apache.org/jira/browse/LANG-854
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>
> NumberUtils#createNumber allows non-hex integers to be Integer, Long or BigInteger, however hex integers are only allowed to be Integer or Long; anything longer than 16 hex digits currently causes a NumberFormatException.
> It might be useful to allow longer hex numbers and convert them to BigInteger.

--
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: http://www.atlassian.com/software/jira

[jira] [Resolved] (LANG-854) NumberUtils#createNumber - does not allow for hex numbers to be larger than Long

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-854.
-----------------------

       Resolution: Fixed
    Fix Version/s: 3.2

URL: http://svn.apache.org/viewvc?rev=1408537&view=rev
Log:
LANG-854 NumberUtils#createNumber - does not allow for hex numbers to be larger than Long

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java

                
> NumberUtils#createNumber - does not allow for hex numbers to be larger than Long
> --------------------------------------------------------------------------------
>
>                 Key: LANG-854
>                 URL: https://issues.apache.org/jira/browse/LANG-854
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 3.2
>
>
> NumberUtils#createNumber allows non-hex integers to be Integer, Long or BigInteger, however hex integers are only allowed to be Integer or Long; anything longer than 16 hex digits currently causes a NumberFormatException.
> It might be useful to allow longer hex numbers and convert them to BigInteger.

--
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: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-854) NumberUtils#createNumber - does not allow for hex numbers to be larger than Long

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495465#comment-13495465 ] 

Sebb commented on LANG-854:
---------------------------

bq. What about binary numbers?

That would the the subject of a separate JIRA.
Note: binary numbers are not handled currently by any of the other conversion routines.

Just noticed that Integer and Long can also be created from octal strings; also not (yet) supported for BigInteger.

Should probably extend #createBigInteger to support octal and hex.
                
> NumberUtils#createNumber - does not allow for hex numbers to be larger than Long
> --------------------------------------------------------------------------------
>
>                 Key: LANG-854
>                 URL: https://issues.apache.org/jira/browse/LANG-854
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>
> NumberUtils#createNumber allows non-hex integers to be Integer, Long or BigInteger, however hex integers are only allowed to be Integer or Long; anything longer than 16 hex digits currently causes a NumberFormatException.
> It might be useful to allow longer hex numbers and convert them to BigInteger.

--
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: http://www.atlassian.com/software/jira