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 committed Nov 14, 2023
1 parent 4599ea0 commit b33fd73
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 b33fd73

Please sign in to comment.