summaryrefslogtreecommitdiffstats
path: root/tests/bugs169/pr315820/MultiAnno2.java
blob: e771983a8157b61402931987d0d7ca4ab222c3d2 (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
27
28
29
30
31
32
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@interface Foo {}

@Retention(RetentionPolicy.RUNTIME)
@interface Bar {
  String value() default "abc";
}

@Retention(RetentionPolicy.RUNTIME)
@interface Goo {
  int value() default 44;
}

aspect A {
//  declare @method: void MultiAnno.m(): @Foo @Bar;
  declare @field: int MultiAnno2.i: @Bar("XYCZ") @Foo @Goo(23);
//  declare @type: MultiAnno: @Bar("ABC") @Foo;
//  declare @constructor: MultiAnno.new(): @Foo @Bar("def");
}

public class MultiAnno2 {
  public MultiAnno2() {}
  public int i;
  public static void main(String[]argv) throws Exception {
    System.out.println(MultiAnno2.class.getDeclaredField("i").getAnnotations()[0]);
    System.out.println(MultiAnno2.class.getDeclaredField("i").getAnnotations()[1]);
  }
  public void m() {
  }
}