summaryrefslogtreecommitdiffstats
path: root/tests/bugs/IfPerThis/Testcase1.java
blob: 38ea7b16c5bc97c21cff3b1fa8dd9cde6063db32 (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
public class Testcase1 {

  public static void main(String [] args) {
	new Testcase1().sayhi();
  }

  public void sayhi() {
  	System.out.println("Hello World");
  }

}

// Note the use of an if inside a perthis, causes the ajc compiler to
//	  throw an exception
aspect Aspect perthis(if(4==3)) {
		
	before () : call(* println(..)) && !within(Aspect*) { 
		System.out.println("Advice 1");
    }

}

aspect Aspect2 pertarget(if(3==4)) {}

aspect Aspect3 percflow(if(3==4)) {}

aspect Aspect4 percflowbelow(if(3==4)) {}