Skip to content

Commit

Permalink
ClientProxyGenerator - fix app class test for producers
Browse files Browse the repository at this point in the history
- and use the produced type to test the app class
- follows up on quarkusio#22828
  • Loading branch information
mkouba committed Jan 14, 2022
1 parent 4bd4e90 commit 54b74c5
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ public ClientProxyGenerator(Predicate<DotName> applicationClassPredicate, boolea
Collection<Resource> generate(BeanInfo bean, String beanClassName,
Consumer<BytecodeTransformer> 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());
Expand Down

0 comments on commit 54b74c5

Please sign in to comment.