From 54b74c52ffccab6bf14a13e33d6d94d89c87285b Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Fri, 14 Jan 2022 10:23:11 +0100 Subject: [PATCH] ClientProxyGenerator - fix app class test for producers - and use the produced type to test the app class - follows up on https://github.com/quarkusio/quarkus/pull/22828 --- .../quarkus/arc/processor/ClientProxyGenerator.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java index 36e2309d0f9d9..3e8ebe33560a3 100644 --- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java +++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ClientProxyGenerator.java @@ -78,7 +78,16 @@ public ClientProxyGenerator(Predicate applicationClassPredicate, boolea Collection generate(BeanInfo bean, String beanClassName, Consumer bytecodeTransformerConsumer, boolean transformUnproxyableClasses) { - ResourceClassOutput classOutput = new ResourceClassOutput(applicationClassPredicate.test(bean.getBeanClass()), + DotName testedName; + // For producers we need to test the produced type + if (bean.isProducerField()) { + testedName = bean.getTarget().get().asField().type().name(); + } else if (bean.isProducerMethod()) { + testedName = bean.getTarget().get().asMethod().returnType().name(); + } else { + testedName = bean.getBeanClass(); + } + ResourceClassOutput classOutput = new ResourceClassOutput(applicationClassPredicate.test(testedName), generateSources); ProviderType providerType = new ProviderType(bean.getProviderType());