org.aspectj/tests/bugs/PR68991/Oxford.java
aclement 64183c3826 Fix and tests for Bugzilla Bug 68991
intertype initialisers should match field set pointcuts
2004-08-11 12:24:27 +00:00

45 lines
641 B
Java

/* initialisers of intertype fields should match field set pointcuts.
In the example below, the output should be
set field set(int C.n)
set field set(int C.m)
get field get(int C.n)
set field set(int C.n)
but the first field set (of C.n) is not picked up.
*/
aspect Aspect {
private int C.n = 13;
before() : get(* C.*) {
System.err.print(":get field "+thisJoinPointStaticPart);
}
before() : set(* C.*) {
System.err.print(":set field "+thisJoinPointStaticPart);
}
public void C.foo() {
n++;
}
}
class C {
int m = 20;
}
public class Oxford {
public static void main(String[] args) {
C c = new C();
c.foo();
}
}