blob: 4874c16389b49fbace185ba1f7abaa941ec159b7 (
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
|
// TESTING: factory returns class but interface specified - not ok as class doesn't implement interface
import org.aspectj.lang.annotation.*;
public class CaseO {
public static void main(String[]argv) {
((I)new CaseO()).foo();
}
}
aspect X {
@DeclareMixin(value="CaseO",interfaces={I.class})
public static C createImplementation1() {return new C();}
}
interface I {
void foo();
}
class C {
void foo() {
System.out.println("foo() running");
}
}
|