aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs162/pr176905/ChainedItd.aj
blob: 441cf70579191f97399d7ef25e260d8f57252978 (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
import java.lang.reflect.Field;
import java.lang.annotation.*;

public aspect ChainedItd {
    declare @field: long *.foo: @Deprecated;
    
    declare @field: @Deprecated * *.foo: @MyAnnotation;
    //uncomment the line below to prove our test should work
    //declare @field: long *.foo: @MyAnnotation;
    
    public static void main(String argz[]) throws Exception {
		Field idField = Test.class.getDeclaredField("foo");
		idField.setAccessible(true);
		assert idField.getAnnotation(MyAnnotation.class) != null;
    }    
}	 

class Test {
    private long foo;
}

@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation {
}