AlbumenJ commented on code in PR #10434:
URL: https://github.com/apache/dubbo/pull/10434#discussion_r942432813
##########
dubbo-filter/dubbo-filter-validation/src/main/java/org/apache/dubbo/validation/support/jvalidation/JValidator.java:
##########
@@ -275,30 +275,30 @@ public void validate(String methodName, Class<?>[]
parameterTypes, Object[] argu
groups.add(1, clazz);
// convert list to array
- Class<?>[] classgroups = groups.toArray(new Class[groups.size()]);
+ Class<?>[] classGroups = groups.toArray(new Class[groups.size()]);
Object parameterBean = getMethodParameterBean(clazz, method,
arguments);
if (parameterBean != null) {
- violations.addAll(validator.validate(parameterBean,
classgroups ));
+ violations.addAll(validator.validate(parameterBean,
classGroups));
}
for (Object arg : arguments) {
- validate(violations, arg, classgroups);
- }
-
- if (!violations.isEmpty()) {
- logger.info("Failed to validate service: " + clazz.getName() +
", method: " + methodName + ", cause: " + violations);
- throw new ConstraintViolationException("Failed to validate
service: " + clazz.getName() + ", method: " + methodName + ", cause: " +
violations, violations);
+ validate(violations, arg, classGroups);
}
} catch (ValidationException e) {
// only use exception's message to avoid potential serialization
issue
throw new ValidationException(e.getMessage());
Review Comment:
`javax.validation.ConstraintViolationException` might have potential
serialization issue. Should be converted.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]