blob: 6f38599135d0f409082399a0c565021f1018f2f8 (
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
|
public class AbstractDeclare {
public static void main(String[] args) {
new C().m();
int y = new C().x;
}
}
class C {
int x;
void m() {}
}
abstract aspect BaseErr {
abstract pointcut acid();
abstract pointcut base();
declare error: acid() && base():
"acid's and base's don't mix";
}
aspect CallErr extends BaseErr {
pointcut acid(): within(AbstractDeclare);
pointcut base(): call(* C.*());
}
aspect GetErr extends BaseErr {
pointcut acid(): within(AbstractDeclare);
pointcut base(): get(* C.*);
}
|