aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/PR527.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/PR527.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/PR527.java')
-rw-r--r--tests/new/PR527.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/new/PR527.java b/tests/new/PR527.java
new file mode 100644
index 000000000..d84e4ef32
--- /dev/null
+++ b/tests/new/PR527.java
@@ -0,0 +1,57 @@
+import org.aspectj.testing.Tester;
+
+/**
+ * PR#527 bug in 1.0beta1 but not HEAD as of 9/24/01
+ * @testcase compile error using pcd if() with advice on introduced methods.
+ */
+public class PR527 {
+ public static void main(String[] args) {
+ new C().run();
+ Tester.checkAllEvents();
+ }
+ static {
+ Tester.expectEvent("run");
+ Tester.expectEvent("test");
+ // Tester.expectEvent("trigger"); replaced in around
+ Tester.expectEvent("after");
+ Tester.expectEvent("callback");
+ Tester.expectEvent("around");
+ }
+}
+class C {
+ public void run() {
+ Tester.event("run");
+ }
+}
+
+aspect A {
+ interface I {
+ }
+
+ public boolean I.test() {
+ Tester.event("test");
+ return true;
+ }
+
+ public void I.trigger() {
+ Tester.event("trigger"); // should not run
+ }
+
+ public void I.callback() {
+ Tester.event("callback");
+ }
+
+ declare parents: C implements I;
+
+ after (C c) : target(c) && execution(public void C.run()) {
+ Tester.event("after");
+ ((I) c).trigger();
+ }
+ void around(I i)
+ : target(i)
+ && execution(public void I.trigger())
+ && if(i.test()) {
+ Tester.event("around");
+ i.callback();
+ }
+}