aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/HierarchyIntroductions.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/HierarchyIntroductions.java
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/HierarchyIntroductions.java')
-rw-r--r--tests/new/HierarchyIntroductions.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/new/HierarchyIntroductions.java b/tests/new/HierarchyIntroductions.java
new file mode 100644
index 000000000..d01f8651d
--- /dev/null
+++ b/tests/new/HierarchyIntroductions.java
@@ -0,0 +1,52 @@
+//!!! ugly test case
+
+public class HierarchyIntroductions {
+ public static void main(String[] args) { test(); }
+
+ static public void test() {
+ C1 c1 = new C1();
+ I1 i1 = c1;
+ C2 c2 = new C2();
+ c2.foo();
+ c1 = c2;
+ I4 i4 = c2;
+ I2 i2 = c1;
+ }
+}
+
+
+aspect Hierarchy {
+ //introduction C1 {
+ declare parents: C1 implements I1;
+ declare parents: C1 implements I2;
+ //}
+
+ //introduction C2 {
+ declare parents: C2 extends C1;
+ //}
+
+ //introduction C4 {
+ declare parents: C4 extends C3;
+ //}
+ //introduction C5 {
+ declare parents: C5 extends C3a;
+ //}
+
+ //introduction I2 {
+ declare parents: I2 extends I3, I4, I5;
+ //}
+}
+
+
+class C1 { public void foo() { } }
+class C2 {}
+class C3 {}
+class C3a extends C3 {}
+class C4 extends C3 {}
+class C5 extends C3 {}
+
+interface I1 {}
+interface I2 {}
+interface I3 {}
+interface I4 {}
+interface I5 {}