blob: c42160f21228e49339b40ef19b46c1be7ff48751 (
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
33
34
35
|
import java.lang.annotation.*;
abstract aspect DAGenTest<X> {
declare @type: X : @MyAnnotation;
declare @method: * X.*(..) : @MyAnnotation;
declare @constructor: X.new(..) : @MyAnnotation;
declare @field: X X.* : @MyAnnotation;
}
@interface MyAnnotation {}
class C {
C c = null;
public C() {}
public void foo() {}
}
aspect Sub extends DAGenTest<C> {
declare warning : staticinitialization(@MyAnnotation *) : "@type ok";
declare warning : execution(@MyAnnotation *.new(..)) : "@constructor ok";
declare warning : execution(@MyAnnotation * *.*(..)) : "@method ok";
declare warning : set(@MyAnnotation * *) : "@field ok";
}
|