diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/MethodConflictsCP.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/MethodConflictsCP.java')
-rw-r--r-- | tests/new/MethodConflictsCP.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/new/MethodConflictsCP.java b/tests/new/MethodConflictsCP.java new file mode 100644 index 000000000..11376ac73 --- /dev/null +++ b/tests/new/MethodConflictsCP.java @@ -0,0 +1,49 @@ +import org.aspectj.testing.Tester; + +public class MethodConflictsCP { + public static void main(String[] args) { + C c = new C(); + Tester.checkEqual(c.ma(), "C"); + Tester.checkEqual(c.m1(), "I1-C"); + Tester.checkEqual(c.m2(), "I2-C"); + + I1 i1 = c; + Tester.checkEqual(i1.m2(), "I2-C"); + + Tester.checkEqual(new CO().toString(), "IO"); + } +} + +class C implements I1, I2 { + public String ma() { return "C"; } + //private void mp() { } +} + +interface BaseI { + public String m1(); + public String m2(); +} + +interface I1 extends BaseI { + static aspect BODY { + public String I1.m1() { return "I1-" + ma(); } + public abstract String I1.ma(); + } +} + +interface I2 extends BaseI { + static aspect BODY { + public String I2.m2() { return "I2-" + ma(); } + public abstract String I2.ma(); + private String I2.mp() { return "I2"; } + } +} + +interface IO { + static aspect BODY { + public String IO.toString() { return "IO"; } + } +} + +class CO implements IO { +} |