diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/AnotherValidNonBlockingFiltersTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/AnotherValidNonBlockingFiltersTest.java index 36008ea22b3bd..ab5880493cbf8 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/AnotherValidNonBlockingFiltersTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/AnotherValidNonBlockingFiltersTest.java @@ -6,6 +6,7 @@ import java.util.function.Supplier; import javax.annotation.Priority; +import javax.enterprise.context.ApplicationScoped; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Priorities; @@ -151,6 +152,7 @@ public void filter(ContainerRequestContext requestContext) throws IOException { } } + @ApplicationScoped public static class CustomFilters { @ServerRequestFilter(nonBlocking = true, priority = Priorities.USER + 20) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/ConditionalBeanFiltersTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/ConditionalBeanFiltersTest.java index 847c460533056..4168dabc5eadc 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/ConditionalBeanFiltersTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/customproviders/ConditionalBeanFiltersTest.java @@ -9,6 +9,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import javax.inject.Singleton; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Priorities; @@ -134,6 +135,7 @@ public Uni uniResponseFilter(ContainerResponseContext ctx) { } } + @Singleton public static class AlwaysEnabledFilter { @ServerRequestFilter(priority = Priorities.USER + 100) diff --git a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/CustomFilterGenerator.java b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/CustomFilterGenerator.java index f6c131328b41a..bb08d63067ee3 100644 --- a/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/CustomFilterGenerator.java +++ b/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/generation/filters/CustomFilterGenerator.java @@ -578,10 +578,10 @@ private FieldDescriptor generateConstructorAndDelegateField(ClassCreator cc, Cla */ private ScopeInspectionResult inspectScope(ClassInfo classInfo) { if (classInfo.hasDeclaredAnnotation(ApplicationScoped.class) || classInfo.hasDeclaredAnnotation(RequestScoped.class)) { - return new ScopeInspectionResult(null, true); + return new ScopeInspectionResult(ApplicationScoped.class, true); } if (classInfo.hasDeclaredAnnotation(Singleton.class)) { - return new ScopeInspectionResult(null, false); + return new ScopeInspectionResult(Singleton.class, false); } List fields = classInfo.fields(); if (fields.isEmpty()) {