Skip to content

Commit

Permalink
BCE - fix a case where method expects BeanInfo, but it is actually In…
Browse files Browse the repository at this point in the history
…terceptorInfo
  • Loading branch information
manovotn authored and Ladicek committed Nov 15, 2023
1 parent 6e0acdb commit 69d5f92
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ void runExtensionMethod(java.lang.reflect.Method method) {
disposer = ((jakarta.enterprise.inject.spi.ProcessProducerMethod<?, ?>) pb)
.getAnnotatedDisposedParameter();
}

argument = new BeanInfoImpl(pb.getBean(), pb.getAnnotated(), disposer, beanManager);
if (pb.getBean() instanceof jakarta.enterprise.inject.spi.Interceptor) {
jakarta.enterprise.inject.spi.Interceptor<?> cdiInterceptor = (jakarta.enterprise.inject.spi.Interceptor<?>) pb
.getBean();
argument = new InterceptorInfoImpl(cdiInterceptor, pb.getAnnotated(), beanManager);
} else {
argument = new BeanInfoImpl(pb.getBean(), pb.getAnnotated(), disposer, beanManager);
}
} else {
argument = argumentForExtensionMethod(parameter, method);
}
Expand Down

0 comments on commit 69d5f92

Please sign in to comment.