From 5c37b57c31cf878a6d91a64c30a7cc95c6f5400b Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 21 Sep 2023 14:58:03 +0300 Subject: [PATCH] Don't register subresource for reflection based on their use as a return type Fixes: #36050 --- .../deployment/ResteasyReactiveProcessor.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java index 63a1959712a48..c52f28315e392 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java @@ -523,17 +523,19 @@ public void accept(EndpointIndexer.ResourceMethodCallbackEntry entry) { .constructors(false).methods().build()); } - reflectiveHierarchy.produce(new ReflectiveHierarchyBuildItem.Builder() - .type(method.returnType()) - .index(index) - .ignoreTypePredicate( - QuarkusResteasyReactiveDotNames.IGNORE_TYPE_FOR_REFLECTION_PREDICATE) - .ignoreFieldPredicate( - QuarkusResteasyReactiveDotNames.IGNORE_FIELD_FOR_REFLECTION_PREDICATE) - .ignoreMethodPredicate( - QuarkusResteasyReactiveDotNames.IGNORE_METHOD_FOR_REFLECTION_PREDICATE) - .source(source) - .build()); + if (!result.getPossibleSubResources().containsKey(method.returnType().name())) { + reflectiveHierarchy.produce(new ReflectiveHierarchyBuildItem.Builder() + .type(method.returnType()) + .index(index) + .ignoreTypePredicate( + QuarkusResteasyReactiveDotNames.IGNORE_TYPE_FOR_REFLECTION_PREDICATE) + .ignoreFieldPredicate( + QuarkusResteasyReactiveDotNames.IGNORE_FIELD_FOR_REFLECTION_PREDICATE) + .ignoreMethodPredicate( + QuarkusResteasyReactiveDotNames.IGNORE_METHOD_FOR_REFLECTION_PREDICATE) + .source(source) + .build()); + } boolean paramsRequireReflection = false; for (short i = 0; i < method.parametersCount(); i++) {