FloydDsilva commented on code in PR #1623:
URL: https://github.com/apache/commons-lang/pull/1623#discussion_r3052827673
##########
src/main/java/org/apache/commons/lang3/math/NumberUtils.java:
##########
@@ -664,13 +666,14 @@ public static boolean isCreatable(final String str) {
|| lastChar == 'l' || lastChar == 'L') {
expEndPos--;
}
+ final String expStr = str.substring(expPos + 1, expEndPos);
try {
- final int exp = Integer.parseInt(str.substring(expPos + 1,
expEndPos));
+ final int exp = Integer.parseInt(expStr);
if (exp == Integer.MIN_VALUE) {
return false;
}
} catch (final NumberFormatException ignored) {
- return false;
+ return ("2147483648".equals(expStr) ||
"+2147483648".equals(expStr)) &&
SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21);
Review Comment:
Hey i have refactored the code and also added more test cases. Kindly let me
know about if more changes are required.
--
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]