Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2414

Interceptor for generic method with generic implementation is not invoked


      public interface BaseService<T> {
          void setSomething(T param);
          T getSomething();
      public abstract class BaseServiceImpl<T> implements BaseService<T> {
          public void setSomething(T param) {
          public T getSomething() {
              return null;
      public interface SpecialService extends BaseService<String> {
          // for declaring some special annotations
          void setSomething(String param);
          String getSomething();
      public class ManagedSpecialServiceImpl extends BaseServiceImpl<String> implements SpecialService {
      public class EJBSpecialServiceImpl extends BaseServiceImpl<String> implements SpecialService {
      1. getSomething() - interceptor is not invoked at all.
      2. Injecting ManagedSpecialServiceImpl as SpecialService - for setSomethig() interceptor is not invoked, moreover setSomethig(Sting) of Weld proxy is bridge method of ManagedSpecialServiceImpl that direct call BaseServiceImpl#setSomethig(Object), so in BaseServiceImpl#setSomethig(Object) we have this = Weld proxy.
      3. Not reproduced by attached testcase, but in my application, for EJB injection interceptor for setSomethig() also is not invoked.

            mkouba@redhat.com Martin Kouba
            avdot Alexander Korsukov (Inactive)
            0 Vote for this issue
            3 Start watching this issue