--- /dev/null
+// simple version - we go bang if Impl doesnt implement I...
+
+package a.b.c;
+
+import org.aspectj.lang.annotation.*;
+
+interface I { public void m(); }
+
+class Impl implements I {
+ public Impl() {}
+ public void m() {}
+}
+
+@Aspect
+class TestBeanAdvice {
+ @DeclareParents(value="a.b.c.TestBean", defaultImpl=a.b.c.Impl.class)
+ private I implementationInterface;
+}
+
+public class TestBean {
+ public static void main(String []argv) throws Exception {
+ ((I)new TestBean()).m();
+ }
+}
+
+class BeansException extends Exception {}
--- /dev/null
+package a.b.c;
+
+import org.aspectj.lang.annotation.*;
+
+interface I { public void m() throws BeansException; }
+
+class Impl implements I {
+ public Impl() {}
+ public void m() throws BeansException { }
+}
+
+@Aspect
+class TestBeanAdvice {
+ @DeclareParents(value="a.b.c.TestBean2", defaultImpl=a.b.c.Impl.class)
+ private I implementationInterface;
+}
+
+public class TestBean2 {
+ public static void main(String []argv) throws Exception {
+ ((I)new TestBean2()).m();
+ }
+}
+
+class BeansException extends Exception {}
--- /dev/null
+// simple version - we go bang if Impl doesnt implement I...
+
+package a.b.c;
+
+import org.aspectj.lang.annotation.*;
+
+interface I { public void m(); }
+
+class Impl { // error!!! implements I {
+ public Impl() {}
+ public void m() {}
+}
+
+@Aspect
+class TestBeanAdvice {
+ @DeclareParents(value="a.b.c.TestBean3", defaultImpl=a.b.c.Impl.class)
+ private I implementationInterface;
+}
+
+public class TestBean3 {
+ public static void main(String []argv) throws Exception {
+ ((I)new TestBean3()).m();
+ }
+}
+
+class BeansException extends Exception {}