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


##########
src/test/java/org/apache/commons/validator/GenericTypeValidatorTest.java:
##########
@@ -171,6 +172,18 @@ void testType() throws ValidatorException {
 
     }
 
+    /**
+     * Tests that {@link GenericTypeValidator#formatLong(String, Locale)} 
rejects values just outside the long range instead of clamping them.
+     */
+    @Test
+    void testLongLocaleOverflow() {
+        assertEquals(Long.valueOf(Long.MAX_VALUE), 
GenericTypeValidator.formatLong("9223372036854775807", Locale.US));

Review Comment:
   Don't use magic strings here. Use Long.MAX|MIN_VALUE converted to a String.



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