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.

NotAndPointcut.java 475B

12345678910111213141516171819202122
  1. import org.aspectj.testing.Tester;
  2. public class NotAndPointcut {
  3. static String str = "";
  4. public static void main(String args[]){
  5. new NotAndPointcut().showBug();
  6. Tester.checkEqual(str, "ran", "advice didn't run");
  7. }
  8. public void showBug(){
  9. }
  10. }
  11. aspect BugInPCD {
  12. pointcut p(): execution(* NotAndPointcut.showBug(..)) &&
  13. ! ( target(NotAndPointcut) && call(* NotAndPointcut.*(..)));
  14. before(): p(){
  15. NotAndPointcut.str += "ran";
  16. }
  17. }