From fab59b5d20ee3ad5d49920c4e9fe785f58820614 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 31 Jan 2022 15:47:27 -0800 Subject: Improve annotation style if pointcut handling This fixes: - negating annotation style if() pointcuts doesn't work - annotation style if() pointcut not able to use a binding that is not exposed Fixes #120,#122 --- tests/bugs198/github_122/E.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/bugs198/github_122/E.java (limited to 'tests/bugs198/github_122/E.java') diff --git a/tests/bugs198/github_122/E.java b/tests/bugs198/github_122/E.java new file mode 100644 index 000000000..29c818285 --- /dev/null +++ b/tests/bugs198/github_122/E.java @@ -0,0 +1,30 @@ +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +/** + * Test !if() pointcuts + */ +public class E { + + public static void main(String []argv) { + new E().run(); + } + + public void run() { + System.out.println("E.run() executing"); + } + +} + +@Aspect class Azpect { + + @Pointcut("!bar()") + public static void foo() {} + + @Pointcut("if()") public static boolean bar() { return false; } + + @Before("foo() && execution(* E.run(..))") public void beforeAdvice() { + System.out.println("advice running"); + } +} \ No newline at end of file -- cgit v1.2.3