diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java index 5f2d5e95e72..3107bc0e384 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java @@ -149,7 +149,7 @@ public class InvocableHandlerMethod extends HandlerMethod { /** * Configure a reactive adapter registry. This is needed for cases where the response is * fully handled within the controller in combination with an async void return value. - *
By default this is a {@link ReactiveAdapterRegistry} with default settings. + *
By default, this is a {@link ReactiveAdapterRegistry} with default settings. */ public void setReactiveAdapterRegistry(ReactiveAdapterRegistry registry) { this.reactiveAdapterRegistry = registry; @@ -163,7 +163,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); }