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.

Case07.aj 555B

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