aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features161/optimizedAnnotationBinding/CaseFour.java
blob: f754af2263bd8c1461b5cdb3623cd20e6b614772 (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
// CaseFour - default value specified and should be extracted
import java.lang.annotation.*;

public class CaseFour {

  public static void main(String []argv) {
    CaseFour o = new CaseFour();
    o.a();
    o.b();
    o.c();
  }

  @Anno public void a() {}
  @Anno(Level.TWO) public void b() {}
  @Anno public void c() {}

}

enum Level { NONE, ONE, TWO, THREE; }

@Retention(RetentionPolicy.RUNTIME)
@interface Anno { Level value() default Level.ONE;}

aspect X {

  before(Level l): execution(@Anno !@Anno(Level.NONE) * *(..)) && @annotation(Anno(l)) {
    System.out.println(l);
  }
}