aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs169/pr315820/MultiAnno.java
blob: 8916c7cf142155f499954200481802c599b0429a (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
import java.lang.annotation.*;

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

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

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

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