Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] within pointcut only matches 'phisically'

Hi there,

Some testing and an earlier thread I found online suggest that within
pointcuts only  pick out join points which are phisically contained
in the specified type. An ITD declared in another Aspect is not
matched. Is that correct and intended?

Here's an example:
-------------------Demo.java---------------------
public class Demo {
              public static void main(String[] argv) {
                            new Demo().added();
               }
}
----------------------------------------------------

------------------SomeAspect.aj----------------
public aspect SomeAspect {
              public void Demo.added() { }

              before() : execution(* Demo.added()) && within(Demo) {
                                System.out.println("executing Demo.added()");
               }
}
----------------------------------------------------

The compiler already gives a warning, that the advice has not been
applied and running the example confirms the warning.

Greetings
Martin



Back to the top