Given the following example classes in my.package
...
public class Foo {
public void logicNotInBar() {/*code*/}
public void logicBarOverrides() {/*code*/}
}
public class Bar extends Foo {
public void logicBarOverrides() {/*code*/}
}
and the following Spring-AOP pointcuts...
<aop:pointcut id="myPointcutAll" expression="execution(* my.package.*.*(..))" />
<aop:pointcut id="myPointcutFoo" expression="execution(* my.package.Foo.*(..))" />
<aop:pointcut id="myPointcutBar" expression="execution(* my.package.Bar.*(..))" />
What is the result of advice applied to the above pointcuts on instances of Bar? In particular...
Bar bar = new Bar();
bar.logicNotInBar(); // will myPointcutBar advice trigger?
bar.logicBarOverrides(); // is myPointcutFoo ignored here?
I think I am missing some basic truth of how pointcuts interact with inheritance so an under-the-hood explanation/doc would probably go a long way.
From aspectj documentation: