mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 02:10:40 +02:00
10c6de6fbc
Special case if(false) to not require a dynamic test
37 lines
700 B
Plaintext
37 lines
700 B
Plaintext
import org.aspectj.testing.Tester;
|
|
|
|
public aspect IfFalse {
|
|
|
|
private static boolean x = false;
|
|
|
|
pointcut p1() : if(false);
|
|
|
|
pointcut p2() : if( false );
|
|
|
|
pointcut p3() : if(x);
|
|
|
|
pointcut p4() : within(IfFalse) && if(false);
|
|
|
|
|
|
after() returning : p1() {
|
|
// should never get here
|
|
Tester.checkFailed("if(false) matched!");
|
|
}
|
|
|
|
after() returning : p2() {
|
|
// should never get here
|
|
Tester.checkFailed("if( false ) matched!");
|
|
}
|
|
|
|
after() returning : p3() {
|
|
// should never get here
|
|
Tester.checkFailed("if(x) matched!");
|
|
}
|
|
|
|
after() returning : p4() {
|
|
// should never get here
|
|
Tester.checkFailed("if(false) matched!");
|
|
}
|
|
|
|
public static void main(String[] args) {}
|
|
} |