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