blob: c3c6312a83873fa5015623fe9257f7be5a43c220 (
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
|
package a;
@TypeAnnotation
public aspect AnnotatedAspect03 {
@FieldAnnotation int foo = 5;
@FieldAnnotation private int ITDMe.goo = 3;
@MethodAnnotation private int ITDMe.getGoo() { return goo; }
@ConstructorAnnotation public ITDMe.new(int x) { this(); goo = x; }
}
class ITDMe {}
aspect VerifyAnnotations {
declare warning : set(@FieldAnnotation * *) : "annotated field";
declare warning : execution(@MethodAnnotation * *(..)) : "annotated method";
declare warning : execution(@ConstructorAnnotation new(..)) : "annotated constructor";
declare warning : staticinitialization(@TypeAnnotation *) : "annotated type";
}
|