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

Interceptor for generic method with generic implementation is not invoked

    Details

      Description

      public interface BaseService<T> {
          void setSomething(T param);
       
          T getSomething();
      }
       
      public abstract class BaseServiceImpl<T> implements BaseService<T> {
          @Override
          public void setSomething(T param) {
          }
       
          @Override
          public T getSomething() {
              return null;
          }
      }
       
      public interface SpecialService extends BaseService<String> {
          @Override
          // for declaring some special annotations
          void setSomething(String param);
       
          @Override
          String getSomething();
      }
       
      @SomeInterceptorBinding
      public class ManagedSpecialServiceImpl extends BaseServiceImpl<String> implements SpecialService {
      }
       
      @Stateless
      @Local(SpecialService.class)
      @SomeInterceptorBinding
      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mkouba Martin Kouba
                  Reporter:
                  avdot Alexander Korsukov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: