Avoid determineValidationGroups not necessary

There is no need to call determineValidationGroups if the method
itself doesn't require method validation.

See gh-36274
This commit is contained in:
rstoyanchev
2026-02-11 09:05:19 +00:00
parent 7240a5a669
commit 849553dc8e
@@ -150,7 +150,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
*/
public void setMethodValidator(@Nullable MethodValidator methodValidator) {
this.methodValidator = methodValidator;
this.validationGroups = (methodValidator != null ?
this.validationGroups = (methodValidator != null && (shouldValidateArguments() || shouldValidateReturnValue()) ?
methodValidator.determineValidationGroups(getBean(), getBridgedMethod()) : EMPTY_GROUPS);
}