title: Spring AOP - advise super class method not overridden in subclass
body: <pre><code>public abstract class AService&lt;T&gt; {
    public T needsToBeAdvised(T param) {
      T result = doSomething(param);
      return result;
    }
  }
  
  @Service
  public class BService extends AService&lt;B&gt; {
    @Override
    public T needsToBeAdvised(T param) {
      return super.needsToBeAdvised(param);
    }
  }
  
  @Service
  public class CService extends AService&lt;C&gt; {}
  
  // (B &amp; C implement an interface AType)
  
  @Component
  @Aspect
  public class MyAspect {
    @Pointcut("execution(* package.AService+.needsToBeAdvised(*))")
    private void aNeedToBeAdvised() {}
  
    @AfterReturning(pointcut="aNeedToBeAdvised()", returning="param")
    public void interceptNeedsToBeAdvised(JoinPoint joinPoint, AType param) {
      // some action
    }
  }
  </code></pre>
  
  <p>Given this setup:</p>
  
  <pre><code>bService.needsToBeAdvised(bParam) //is intercepted
  </code></pre>
  
  <p>but,</p>
  
  <pre><code>cService.needsToBeAdvised(cParam) //is NOT.
  </code></pre>
  
  <p>How do I achieve this without overriding <code>needsToBeAdvised()</code> in <code>CService</code>?</p>
  
  <p>EDIT:</p>
  
  <p>I should add that <code>BService</code> and <code>CService</code> are both in the same package. </p>
  
  <p>If I change my point-cut to the following: </p>
  
  <pre><code>@Pointcut("execution(* package.CService.needsToBeAdvised(*))")
  
  cService.needsToBeAdvised(cParam) //is still not intercepted
  </code></pre>
  
  <p>The only way it works is if I override <code>needsTobeAdvised()</code> in <code>CService</code></p>