blob: 383588f5542b6cb44d60716abe66a47de104338d (
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
|
// "public annotated ITD-on-itself field"
import java.lang.annotation.*;
import java.lang.reflect.Field;
@Retention(RetentionPolicy.RUNTIME)
@interface anInterface{}
aspect B29 {
@anInterface
public int B29.a;
public static void main(String [] args){
Class c = B29.class;
try {
Field m = c.getDeclaredField("a");
Annotation [] anns = m.getDeclaredAnnotations();
for (int i = 0;i < anns.length;i++){
System.out.println(anns[i]);
}
} catch (Exception e){
System.out.println("exceptional!");
}
}
}
|