summaryrefslogtreecommitdiffstats
path: root/tests/features161/optimizedAnnotationBinding/CaseTwo.java
blob: fab8f6eeb67f9c73e52564c5370bb284ae65ddbb (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
33
// CaseTwo - no such field in the annotation 
import java.lang.annotation.*;

public class CaseTwo {

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

                     public void a() {}
  @Anno("A")  public void b() {}
  @Anno("B")   public void c() {}
  @Anno("C")   public void d() {}
  @Anno public void e() {}

}

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

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

aspect X {

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