aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-01-07 13:10:07 +0000
committeracolyer <acolyer>2004-01-07 13:10:07 +0000
commitc517e8507cbc0be482d3eb1be2694e3f6486a4e3 (patch)
treebf367565a440bb3007b85213648e475eb0abfd59 /tests/bugs
parent6cded1d30cf1e59ee133ac08f44dabb7859b4fed (diff)
downloadaspectj-c517e8507cbc0be482d3eb1be2694e3f6486a4e3.tar.gz
aspectj-c517e8507cbc0be482d3eb1be2694e3f6486a4e3.zip
fix for bug 49457 - test for duplicate pointcut definitions in classes
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);
+
+}