You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Case16.aj 586B

1234567891011121314151617181920212223242526272829
  1. // "public abstract annotated ITD method"
  2. import java.lang.annotation.*;
  3. import java.lang.reflect.Method;
  4. @Retention(RetentionPolicy.RUNTIME)
  5. @interface anInterface{}
  6. abstract class A16{
  7. }
  8. aspect B16 {
  9. @anInterface
  10. public abstract void A16.a();
  11. public static void main(String [] args){
  12. Class c = A16.class;
  13. try {
  14. Method m = c.getDeclaredMethod("a", new Class [0]);
  15. Annotation [] anns = m.getDeclaredAnnotations();
  16. for (int i = 0;i < anns.length;i++){
  17. System.out.println(anns[i]);
  18. }
  19. } catch (Exception e){
  20. System.out.println("exceptional!");
  21. }
  22. }
  23. }