From 3d5c7ab0bff432c50f2634e6c149aa1e640786fc Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 19 Nov 2007 16:53:54 +0000 Subject: [PATCH] 86818: testcode --- tests/bugs154/pr86818/Four.java | 18 ++++++++++++++++++ tests/bugs154/pr86818/One.java | 11 +++++++++++ tests/bugs154/pr86818/Three.java | 15 +++++++++++++++ tests/bugs154/pr86818/Two.java | 15 +++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 tests/bugs154/pr86818/Four.java create mode 100644 tests/bugs154/pr86818/One.java create mode 100644 tests/bugs154/pr86818/Three.java create mode 100644 tests/bugs154/pr86818/Two.java diff --git a/tests/bugs154/pr86818/Four.java b/tests/bugs154/pr86818/Four.java new file mode 100644 index 000000000..6ed474fd0 --- /dev/null +++ b/tests/bugs154/pr86818/Four.java @@ -0,0 +1,18 @@ +// Four.m() is ITD from another aspect - and itd is annotated +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) @interface A {} + +public class Four { +// public void m() {} --> gone to aspect + public static void main(String []argv) { + if (!(new Four() instanceof java.io.Serializable)) System.err.println("declare parents failed"); + } +} + +aspect Y { + public void Four.m() {} +} +aspect X { + declare parents: hasmethod(@A * * *(..)) implements java.io.Serializable; +} diff --git a/tests/bugs154/pr86818/One.java b/tests/bugs154/pr86818/One.java new file mode 100644 index 000000000..18113d5f1 --- /dev/null +++ b/tests/bugs154/pr86818/One.java @@ -0,0 +1,11 @@ +// Should work fine, One gets Serializable +public class One { + public void m() {} + public static void main(String []argv) { + if (!(new One() instanceof java.io.Serializable)) System.err.println("declare parents failed"); + } +} + +aspect X { + declare parents: hasmethod(public void m()) implements java.io.Serializable; +} diff --git a/tests/bugs154/pr86818/Three.java b/tests/bugs154/pr86818/Three.java new file mode 100644 index 000000000..59eb5592a --- /dev/null +++ b/tests/bugs154/pr86818/Three.java @@ -0,0 +1,15 @@ +// Three.m() is ITD from another aspect. Aspects other way round to case Two + +public class Three { +// public void m() {} --> gone to aspect + public static void main(String []argv) { + if (!(new Three() instanceof java.io.Serializable)) System.err.println("declare parents failed"); + } +} + +aspect Y { + public void Three.m() {} +} +aspect X { + declare parents: hasmethod(public void m()) implements java.io.Serializable; +} diff --git a/tests/bugs154/pr86818/Two.java b/tests/bugs154/pr86818/Two.java new file mode 100644 index 000000000..5bec66649 --- /dev/null +++ b/tests/bugs154/pr86818/Two.java @@ -0,0 +1,15 @@ +// Two.m() is ITD from another aspect +public class Two { +// public void m() {} --> gone to aspect + public static void main(String []argv) { + if (!(new Two() instanceof java.io.Serializable)) System.err.println("declare parents failed"); + } +} + + +aspect X { + declare parents: hasmethod(public void m()) implements java.io.Serializable; +} +aspect Y { + public void Two.m() {} +} -- 2.39.5