diff options
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; +} + |