blob: dedcabae93eb56448f0f88679ff2ad79ea04240c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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");
}
}
|