Skip to main content

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

super calls cannot be matched with the call() pcd, execution() will match it.

From the AspectJ doc:

The join points defined by AspectJ are:
Method call
   When a method is called, not including super calls of non-static methods.

there was a recent thread about why this is the case and discussion
about perhaps addressing it...


On 22/06/06, Gu Dake <folklayer@xxxxxxxxxxx> wrote:

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() {

package test;
class A {
 public void another(){
public class B extends A {
 public void method() {

 public static void main(String[] args) {
   new B().method();

aspectj-users mailing list

Back to the top