--- /dev/null
+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());
+ }
+}
--- /dev/null
+package impl;
+
+public interface Foo {
+ public void doFoo();
+}
+
--- /dev/null
+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;
+}
+
--- /dev/null
+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;
+}
+