mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-26 17:58:43 +02:00
![aclement](/assets/img/avatar_default.png)
An if() pointcut inside a perthis() clause causes an ABORT - null pointer exception in ajc
27 lines
520 B
Java
27 lines
520 B
Java
public class Testcase1 {
|
|
|
|
public static void main(String [] args) {
|
|
new Testcase1().sayhi();
|
|
}
|
|
|
|
public void sayhi() {
|
|
System.out.println("Hello World");
|
|
}
|
|
|
|
}
|
|
|
|
// Note the use of an if inside a perthis, causes the ajc compiler to
|
|
// throw an exception
|
|
aspect Aspect perthis(if(4==3)) {
|
|
|
|
before () : call(* println(..)) && !within(Aspect*) {
|
|
System.out.println("Advice 1");
|
|
}
|
|
|
|
}
|
|
|
|
aspect Aspect2 pertarget(if(3==4)) {}
|
|
|
|
aspect Aspect3 percflow(if(3==4)) {}
|
|
|
|
aspect Aspect4 percflowbelow(if(3==4)) {} |