garydgregory commented on code in PR #1623:
URL: https://github.com/apache/commons-lang/pull/1623#discussion_r3044701688


##########
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:
   This is rather messy IMO. You'll need to provide comments here to explain 
what's going on. The magic strings should likely be derived from constants like 
`Integer.MAX_VALUE`.



-- 
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]

Reply via email to