Alwaysgaurav1 opened a new pull request, #1796:
URL: https://github.com/apache/commons-lang/pull/1796
### Summary
Fixes an issue where `NumberUtils.createNumber()` threw
`NumberFormatException` when given valid positive `Long` or `BigInteger`
literals with an explicit `+` sign and `l`/`L` type qualifier (e.g. `"+100L"`,
`"+0L"`, `"+12345678901234567890L"`), which also caused
`NumberUtils.isCreatable()` to unexpectedly return `false`.
### Problem
In `NumberUtils.createNumber(str)`:
```java
case 'l':
case 'L':
if (dec == null && exp == null && (!numeric.isEmpty() &&
numeric.charAt(0) == '-' && isDigits(numeric.substring(1)) ||
isDigits(numeric))) {
try {
return createLong(numeric);
} catch (final NumberFormatException ignored) {
// Too big for a long
}
return createBigInteger(numeric);
}
throw new NumberFormatException(str + " is not a valid number.");
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]