]> source.dussan.org Git - aspectj.git/commitdiff
declareMixin
authoraclement <aclement>
Tue, 3 Mar 2009 19:13:40 +0000 (19:13 +0000)
committeraclement <aclement>
Tue, 3 Mar 2009 19:13:40 +0000 (19:13 +0000)
tests/features164/declareMixin/CaseA.java [new file with mode: 0644]

diff --git a/tests/features164/declareMixin/CaseA.java b/tests/features164/declareMixin/CaseA.java
new file mode 100644 (file)
index 0000000..ac49334
--- /dev/null
@@ -0,0 +1,25 @@
+import org.aspectj.lang.annotation.*;
+
+public class CaseA {
+  public static void main(String[]argv) {
+    CaseA ca = new CaseA();
+    ((I)ca).methodOne();
+  }
+}
+
+aspect X {
+  @DeclareMixin("CaseA")
+  public I createImplementation() {
+    return new Implementation();
+  }
+}
+
+interface I {
+  void methodOne();
+}
+
+class Implementation implements I {
+  public void methodOne() {
+    System.out.println("methodOne running");
+  }
+}