aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features160/annotationValueMatching/MultiTypePatterns.java
blob: 84cf4682a37958791e3b5d2fafe5a5f4fd4c8c94 (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
// testing what happens with multiple annotations together in a type pattern list @(A B C) type thing


enum Rainbow { RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET }

@interface Col1 { Rainbow value() default Rainbow.RED; }
@interface Col2 { Rainbow value() default Rainbow.YELLOW; }

aspect X {
  before(): execution(@(Col1 && Col2) * *(..)) {
    System.err.println("advising "+thisJoinPoint);
  }
}

public class MultiTypePatterns {

  public static void main(String[] args) {
    MultiTypePatterns eOne = new MultiTypePatterns();
  }

  @Col1 public void m001() {}
  @Col2 public void m002() {}
  @Col1 @Col2 public void m003() {}

}