garydgregory commented on code in PR #387:
URL: https://github.com/apache/commons-validator/pull/387#discussion_r3367589292


##########
src/main/java/org/apache/commons/validator/GenericTypeValidator.java:
##########
@@ -405,10 +405,13 @@ public static Long formatLong(final String value, final 
Locale locale) {
             final Number num = formatter.parse(value, pos);
 
             // If there was no error      and we used the whole string
+            // NumberFormat returns a Long only when the value fits in a long;
+            // out-of-range input is returned as a Double, so a doubleValue()
+            // range check cannot be used here (Long.MAX_VALUE is not exactly
+            // representable as a double and would let 2^63 through).

Review Comment:
   Hi @sahvx655-wq 
   
   Thank you for your update.
   
   Either we have tests missing or checking `pos` for errors is superfluous. 
WDYT?
   



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