diff options
Diffstat (limited to 'tests/bugs150/pr98901/Case25.aj')
-rw-r--r-- | tests/bugs150/pr98901/Case25.aj | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/bugs150/pr98901/Case25.aj b/tests/bugs150/pr98901/Case25.aj new file mode 100644 index 000000000..d67f97343 --- /dev/null +++ b/tests/bugs150/pr98901/Case25.aj @@ -0,0 +1,28 @@ +// "public annotated field" + +import java.lang.annotation.*; +import java.lang.reflect.Field; + +@Retention(RetentionPolicy.RUNTIME) +@interface anInterface{} + +class A25{ + @anInterface + public int a; +} + +aspect B25 { + + public static void main(String [] args){ + Class c = A25.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!"); + } + } +} |