[
https://issues.apache.org/jira/browse/LANG-1644?focusedWorklogId=560758&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-560758
]
ASF GitHub Bot logged work on LANG-1644:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Mar/21 00:29
Start Date: 04/Mar/21 00:29
Worklog Time Spent: 10m
Work Description: aherbert commented on pull request #727:
URL: https://github.com/apache/commons-lang/pull/727#issuecomment-790185530
Is the intention that this should match `isCreateable(String)` for all valid
hex numbers and return `true` for all hex cases where a `Number` is returned
from `createNumber(String)`?
```java
public static boolean isCreatable(final String str)
public static Number createNumber(final String str)
```
If so then you should support the `#` character (and all the other hex
prefixes) and update the javadoc to reflect the intention.
I would then update the test to use all the hex cases from the tests for
`createNumber` and `isCreateable` to ensure it returns `true` when those
methods succeed.
Currently your test only covers a range of `int` and `long` values, no hex
variants and does not specify whether BigInteger values are also `true`.
It will also fail on valid hex numbers such as `0x1L`.
----------------------------------------------------------------
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: 560758)
Time Spent: 1h 20m (was: 1h 10m)
> 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: 1h 20m
> 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)