aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/declare/DecaType2.java
blob: 19306daf19298b1a4d0c500aea00ef935409699d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.lang.annotation.*;

public class DecaType2 {
  public static void main(String[] argv) {
  	Annotation a = DecaType2.class.getAnnotation(MyAnnotation.class);
        System.err.println("annotation on DecaType2 is "+a);
  	a = X.class.getAnnotation(MyAnnotation.class);
        System.err.println("annotation on X is "+a);
  	a = MyAnnotation.class.getAnnotation(MyAnnotation.class);
        System.err.println("annotation on MyAnnotation is "+a);
  }
}

aspect X {
  declare @type: * : @MyAnnotation;
}

@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@interface MyAnnotation {}