From 69d5f92595b24cc59212748594e8b1a1a2399b2e Mon Sep 17 00:00:00 2001 From: Matej Novotny Date: Tue, 14 Nov 2023 16:54:51 +0100 Subject: [PATCH] BCE - fix a case where method expects BeanInfo, but it is actually InterceptorInfo --- .../extension/translator/ExtensionPhaseRegistration.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/weld-lite-extension-translator/src/main/java/org/jboss/weld/lite/extension/translator/ExtensionPhaseRegistration.java b/weld-lite-extension-translator/src/main/java/org/jboss/weld/lite/extension/translator/ExtensionPhaseRegistration.java index 40b8102912..56e7509781 100644 --- a/weld-lite-extension-translator/src/main/java/org/jboss/weld/lite/extension/translator/ExtensionPhaseRegistration.java +++ b/weld-lite-extension-translator/src/main/java/org/jboss/weld/lite/extension/translator/ExtensionPhaseRegistration.java @@ -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); }