aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/OverloadedPointcutsInAspect.java23
-rw-r--r--tests/bugs/OverloadedPointcutsInClass.java9
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs/OverloadedPointcutsInAspect.java b/tests/bugs/OverloadedPointcutsInAspect.java
new file mode 100644
index 000000000..d483a1885
--- /dev/null
+++ b/tests/bugs/OverloadedPointcutsInAspect.java
@@ -0,0 +1,23 @@
+class OverloadedPointcutsInAspect {
+ public static void main(String[] args) {
+ new C().run();
+ }
+}
+class C {
+ public void run() {}
+}
+
+aspect A {
+ declare parents: C implements Runnable;
+ declare parents: C implements SubRunnable;
+ interface SubRunnable extends Runnable {}
+
+ pointcut pc(Runnable r) : target(r) && call(void run());
+ pointcut pc(SubRunnable r) : target(r) && call(void run());
+ before(Runnable r) : pc(r) { log("pc(Runnable r)"); }
+ before(SubRunnable r) : pc(r) { log("pc(SubRunnable r)"); }
+ before() : pc(Runnable) { log("pc(Runnable)"); }
+ before() : pc(SubRunnable) { log("pc(SubRunnable)"); }
+ before() : pc(*) { log("pc(*)"); }
+ void log(String s) { System.out.println(s); }
+}
diff --git a/tests/bugs/OverloadedPointcutsInClass.java b/tests/bugs/OverloadedPointcutsInClass.java
new file mode 100644
index 000000000..49aff6996
--- /dev/null
+++ b/tests/bugs/OverloadedPointcutsInClass.java
@@ -0,0 +1,9 @@
+public class OverloadedPointcutsInClass {
+
+ pointcut pc1(): call(* *(..));
+ pointcut pc1(): execution(* *(..));
+
+ pointcut pc2(String s): call(* *(..)) && target(s);
+ pointcut pc2(StringBuffer sb): call(* *(..)) && target(sb);
+
+}