diff options
author | aclement <aclement> | 2008-12-06 05:12:23 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-12-06 05:12:23 +0000 |
commit | baf669ff24513592a4e553e7aa6f629e42ec54db (patch) | |
tree | 8aa77b16eb2f8c0ba51dbc4fae66a951f9a88d70 /tests/bugs163 | |
parent | c2b29e1ed1e75f6f03629241c27e794a9410c35f (diff) | |
download | aspectj-baf669ff24513592a4e553e7aa6f629e42ec54db.tar.gz aspectj-baf669ff24513592a4e553e7aa6f629e42ec54db.zip |
257754: decp anno: test and fix
Diffstat (limited to 'tests/bugs163')
-rw-r--r-- | tests/bugs163/pr257754/DefaultFoo.java | 13 | ||||
-rw-r--r-- | tests/bugs163/pr257754/Foo.java | 6 | ||||
-rw-r--r-- | tests/bugs163/pr257754/Main.java | 38 | ||||
-rw-r--r-- | tests/bugs163/pr257754/Main2.java | 26 |
4 files changed, 83 insertions, 0 deletions
diff --git a/tests/bugs163/pr257754/DefaultFoo.java b/tests/bugs163/pr257754/DefaultFoo.java new file mode 100644 index 000000000..b0aaf41d5 --- /dev/null +++ b/tests/bugs163/pr257754/DefaultFoo.java @@ -0,0 +1,13 @@ +package impl; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclareParents; + +public class DefaultFoo implements Foo { +// Uncommenting the following fixes the error + DefaultFoo() { + } + public void doFoo() { + System.out.println("In doFoo " + this.getClass()); + } +} diff --git a/tests/bugs163/pr257754/Foo.java b/tests/bugs163/pr257754/Foo.java new file mode 100644 index 000000000..466ba55d5 --- /dev/null +++ b/tests/bugs163/pr257754/Foo.java @@ -0,0 +1,6 @@ +package impl; + +public interface Foo { + public void doFoo(); +} + diff --git a/tests/bugs163/pr257754/Main.java b/tests/bugs163/pr257754/Main.java new file mode 100644 index 000000000..1da2bd117 --- /dev/null +++ b/tests/bugs163/pr257754/Main.java @@ -0,0 +1,38 @@ +package example; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclareParents; + +public class Main { + public static void main(String[] args) { + Bar bar = new Bar(); + ((Foo)bar).doFoo(); + bar.doBar(); + } +} + +interface Foo { + public void doFoo(); +} + +class DefaultFoo implements Foo { +// Uncommenting the following fixes the error +// public DefaultFoo() { +// } + public void doFoo() { + System.out.println("In doFoo " + this.getClass()); + } +} + +class Bar { + public void doBar() { + System.out.println("Bar"); + } +} + +@Aspect +class Introduce { + @DeclareParents(value="example.Bar", defaultImpl=DefaultFoo.class) + private Foo mixin; +} + diff --git a/tests/bugs163/pr257754/Main2.java b/tests/bugs163/pr257754/Main2.java new file mode 100644 index 000000000..4f40a5bf7 --- /dev/null +++ b/tests/bugs163/pr257754/Main2.java @@ -0,0 +1,26 @@ +package example; +import impl.*; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclareParents; + +public class Main2 { + public static void main(String[] args) { + Bar bar = new Bar(); + ((Foo)bar).doFoo(); + bar.doBar(); + } +} + +class Bar { + public void doBar() { + System.out.println("Bar"); + } +} + +@Aspect +class Introduce { + @DeclareParents(value="example.Bar", defaultImpl=impl.DefaultFoo.class) + private Foo mixin; +} + |