blob: 03165b10514611c4d4c95506e99d2f7ead6465ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package a;
@TypeAnnotation
public aspect AnnotatedAspect {
@FieldAnnotation int foo = 5;
@MethodAnnotation int getFoo() { return foo; }
@ConstructorAnnotation
public AnnotatedAspect() {}
}
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";
}
|