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.

E.java 576B

123456789101112131415161718192021222324252627282930
  1. import org.aspectj.lang.annotation.Aspect;
  2. import org.aspectj.lang.annotation.Before;
  3. import org.aspectj.lang.annotation.Pointcut;
  4. /**
  5. * Test !if() pointcuts
  6. */
  7. public class E {
  8. public static void main(String []argv) {
  9. new E().run();
  10. }
  11. public void run() {
  12. System.out.println("E.run() executing");
  13. }
  14. }
  15. @Aspect class Azpect {
  16. @Pointcut("!bar()")
  17. public static void foo() {}
  18. @Pointcut("if()") public static boolean bar() { return false; }
  19. @Before("foo() && execution(* E.run(..))") public void beforeAdvice() {
  20. System.out.println("advice running");
  21. }
  22. }