Added
Link Here
|
1 |
import java.lang.reflect.Field; |
2 |
import java.lang.annotation.*; |
3 |
|
4 |
public aspect ChainedItd { |
5 |
declare @field: long *.foo: @Deprecated; |
6 |
|
7 |
declare @field: @Deprecated * *.foo: @MyAnnotation; |
8 |
//uncomment the line below to prove our test should work |
9 |
//declare @field: long *.foo: @MyAnnotation; |
10 |
|
11 |
public static void main(String argz[]) throws Exception { |
12 |
Field idField = Test.class.getDeclaredField("foo"); |
13 |
idField.setAccessible(true); |
14 |
assert idField.getAnnotation(MyAnnotation.class) != null; |
15 |
} |
16 |
} |
17 |
|
18 |
class Test { |
19 |
private long foo; |
20 |
} |
21 |
|
22 |
@Retention(RetentionPolicy.RUNTIME) |
23 |
@interface MyAnnotation { |
24 |
} |