Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Cannot catch calling super method

The following aspect caught "another()", but did not catch "super.another()".  Anything wrong?  This really does not make sense.
 
 
======================================================
 
package test;
 
public aspect MyAspect {
    pointcut catchCall(): !within(MyAspect) && call(* *.*(..));
before(): catchCall() {
    System.out.println(thisJoinPointStaticPart);
}
}
======================================================
package test;
class A {
 public void another(){
 }
}
public class B extends A {
 public void method() {
  super.another();
  another();
 }
 public static void main(String[] args) {
   new B().method();
 }
}

Back to the top