diff --git a/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java b/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java index 0e47168c16a72..b16114d300a54 100644 --- a/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java @@ -14,7 +14,6 @@ import java.io.File; import java.io.IOException; -import java.lang.reflect.Modifier; import java.nio.file.Path; import java.util.ArrayDeque; import java.util.ArrayList; @@ -854,18 +853,6 @@ private FilterClassIntrospector createFilterClassIntrospector() { return ab.get(); } - @BuildStep - EndpointValidationPredicatesBuildItem createSpringRestControllerPredicate() { - Predicate predicate = new Predicate() { - @Override - public boolean test(ClassInfo classInfo) { - return Modifier.isInterface(classInfo.flags()) - || Modifier.isAbstract(classInfo.flags()); - } - }; - return new EndpointValidationPredicatesBuildItem(predicate); - } - // We want to add @Typed to resources, beanparams and providers so that they can be resolved as CDI bean using purely their // class as a bean type. This removes any ambiguity that potential subclasses may have. @BuildStep diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java index 63aa10ffb1b6b..ae5576b31d7a2 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java @@ -88,6 +88,7 @@ import java.nio.charset.StandardCharsets; import java.util.AbstractMap; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -268,7 +269,7 @@ protected EndpointIndexer(Builder builder) { this.isDisabledCreator = builder.isDisabledCreator; this.skipMethodParameter = builder.skipMethodParameter; this.skipNotRestParameters = builder.skipNotRestParameters; - this.validateEndpoint = builder.validateEndpoint; + this.validateEndpoint = builder.defaultPredicate; } public Optional createEndpoints(ClassInfo classInfo, boolean considerApplication) { @@ -1714,7 +1715,13 @@ public boolean handleMultipartForReturnType(AdditionalWriters additionalWriters, private Function> isDisabledCreator = null; private Predicate> skipMethodParameter = null; - private List> validateEndpoint = null; + private List> defaultPredicate = Arrays.asList(new Predicate<>() { + @Override + public boolean test(ClassInfo classInfo) { + return Modifier.isInterface(classInfo.flags()) + || Modifier.isAbstract(classInfo.flags()); + } + }); private boolean skipNotRestParameters = false; @@ -1852,7 +1859,10 @@ public B setSkipMethodParameter( } public B setValidateEndpoint(List> validateEndpoint) { - this.validateEndpoint = validateEndpoint; + List> predicates = new ArrayList<>(validateEndpoint.size() + 1); + predicates.addAll(validateEndpoint); + predicates.addAll(this.defaultPredicate); + this.defaultPredicate = predicates; return (B) this; }