aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features164/declareMixin/CaseQ.java
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-06 18:49:55 +0000
committeraclement <aclement>2009-03-06 18:49:55 +0000
commit47fab0075ffd3252a2ab125a85db190c8124df45 (patch)
treecf3b26317cf2bef7f1580de50361be3e4de0cdf0 /tests/features164/declareMixin/CaseQ.java
parentfccbab59a264a7351822adcadd65af8570f216e8 (diff)
downloadaspectj-47fab0075ffd3252a2ab125a85db190c8124df45.tar.gz
aspectj-47fab0075ffd3252a2ab125a85db190c8124df45.zip
declaremixin
Diffstat (limited to 'tests/features164/declareMixin/CaseQ.java')
-rw-r--r--tests/features164/declareMixin/CaseQ.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/features164/declareMixin/CaseQ.java b/tests/features164/declareMixin/CaseQ.java
new file mode 100644
index 000000000..dedcabae9
--- /dev/null
+++ b/tests/features164/declareMixin/CaseQ.java
@@ -0,0 +1,32 @@
+// TESTING: factory return type implements two interfaces, both should be mixed as specified
+import org.aspectj.lang.annotation.*;
+
+public class CaseQ {
+ public static void main(String[]argv) {
+ ((I)new CaseQ()).foo();
+ ((J)new CaseQ()).goo();
+ }
+}
+
+aspect X {
+ @DeclareMixin(value="CaseQ",interfaces={I.class,J.class})
+ public static C createImplementation1() {return new C();}
+
+}
+
+interface I {
+ void foo();
+}
+
+interface J {
+ void goo();
+}
+
+class C implements I,J {
+ public void foo() {
+ System.out.println("foo() running");
+ }
+ public void goo() {
+ System.out.println("goo() running");
+ }
+}