You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IfTrue.aj 721B

12345678910111213141516171819202122232425262728293031323334353637
  1. import org.aspectj.testing.Tester;
  2. public aspect IfTrue {
  3. private static boolean x = true;
  4. pointcut p1() : !if(true);
  5. pointcut p2() : !if( true );
  6. pointcut p3() : !if(x) && execution(* *(..));
  7. pointcut p4() : within(IfTrue) && !if(true);
  8. after() returning : p1() {
  9. // should never get here
  10. Tester.checkFailed("!if(true) matched!");
  11. }
  12. after() returning : p2() {
  13. // should never get here
  14. Tester.checkFailed("!if( true ) matched!");
  15. }
  16. after() returning : p3() {
  17. // should never get here
  18. Tester.checkFailed("!if(x) matched!");
  19. }
  20. after() returning : p4() {
  21. // should never get here
  22. Tester.checkFailed("!if(true) matched!");
  23. }
  24. public static void main(String[] args) {}
  25. }