org.aspectj/tests/new/IfPCDAssignmentCE.java
2002-12-16 18:51:06 +00:00

27 lines
585 B
Java

public class IfPCDAssignmentCE {
public static void main (String[] args) {
foo(new C());
}
static void foo(C a) {}
}
class C {
static boolean doit() { return true; }
static boolean doit(C a) { return true; }
}
aspect A {
before(C c) : args(c) && call(void foo(C))
&& if ((c=new C()).doit()) { // CE 16
}
before(C c) : args(c) && call(void foo(C))
&& if (C.doit(c = new C())) { // CE 20
}
}
/*
Expecting compiler error on attempts to assign bound variable
in if() PCD. Currently getting compiler stack trace.
*/