method,
arguments,
groups));
if (!constraintViolations.isEmpty()) {
throw new ConstraintViolationException("Validation error when calling method '"
+ method
+ "' with arguments "
+ Arrays.deepToString(arguments), constraintViolations);
}
Object returnedValue = invocation.proceed();
if (validate.validateReturnedValue()) {
constraintViolations.addAll(methodValidator.validateReturnedValue(clazz, method, returnedValue, groups));
if (!constraintViolations.isEmpty()) {
throw new ConstraintViolationException("Method '"
+ method
+ "' returned a not valid value "
+ returnedValue, constraintViolations);
}
}