summaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/declare/atmethodctor/TwoOnOneMember2.aj
blob: 633caa0fc4f1bbcb1610fed909877d17a8799ce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// trying to put two annotations onto one a method and two on a ctor
// - should be OK, they are diff annotations
public aspect TwoOnOneMember2 {
  declare @method: public void m1() : @Colored("red");
  declare @method: public void m1() : @Fruit("tomato");
  declare @constructor: new(int) : @Colored("green");
  declare @constructor: new(int) : @Fruit("apple");
}

aspect X {
  before(): call(* *(..)) && @annotation(Colored) {
    System.err.println("Colored method call at "+thisJoinPoint.getSourceLocation());
  }
  before(): call(* *(..)) && @annotation(Fruit) {
    System.err.println("Fruit method call at "+thisJoinPoint.getSourceLocation());
  }
  before(): call(new(..)) && @annotation(Colored) {
    System.err.println("Colored ctor call at "+thisJoinPoint.getSourceLocation());
  }
  before(): call(new(..)) && @annotation(Fruit) {
    System.err.println("Fruit ctor call at "+thisJoinPoint.getSourceLocation());
  }
}