[ 
https://issues.apache.org/jira/browse/LANG-1644?focusedWorklogId=561032&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-561032
 ]

ASF GitHub Bot logged work on LANG-1644:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Mar/21 17:51
            Start Date: 04/Mar/21 17:51
    Worklog Time Spent: 10m 
      Work Description: aherbert commented on pull request #727:
URL: https://github.com/apache/commons-lang/pull/727#issuecomment-790806626


   Regarding `0x1L` the NumberUtils.createNumber and NumberUtils.isCreatable 
only supports the preferred type suffix on decimal numbers. You cannot specify 
a preferred `L` for hex integers. So this new method should match the existing 
behaviour of those methods. So you can ignore this.
   
   I am not sure that allowing the number `5D0` to be `true` is valid. This 
would not be parsed or created as a Hex integer by any method in NumberUtils. 
`Integer.decode("5D0")` throws an exception. Thus a hex number should be 
identified with `0x`, `0X` or `#` with an optional sign prefix (see [LANG-1645] 
and #728) and thereafter only contain the digits `[0-9A-Fa-f]`.
   
   This method then becomes a subset of `isCreateable` that will return true 
only if the `Number` created by `createNumber` is a mathematical integer.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 561032)
    Time Spent: 3h 10m  (was: 3h)

> Check if number is hexadecimal
> ------------------------------
>
>                 Key: LANG-1644
>                 URL: https://issues.apache.org/jira/browse/LANG-1644
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Arturo Bernal
>            Priority: Minor
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> IMO would be fine have a method that given a String tell you if is a valid 
> hexadecimal number instead of try to create the number. should be valid:
>  
>  * 5D0
>  * 0x7FFFFFFFFFFFFFFF
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to