summaryrefslogtreecommitdiffstats
path: root/tests/bugs160/simplejava/SimpleN.java
blob: e3ba010f694197ab7cc8a1dfbca08989e4eb0aa7 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
import org.aspectj.lang.annotation.*;

public class SimpleN {
  public static void main(String[]argv) {
   new A().m(1,2,3);
  }
}

class A {
  public void m(int p,int q,int r) {
    String s= "Hello";
    if (s.equals("five")) {
      int i = 5;
      System.out.println("Je suis ici "+i);
      i = i + 6;
      if (i==3) {
        String p2 = "foo";
      }
    } else {
      int j = 6;
      System.out.println("Ich bin hier "+j);
    }
    System.out.println("Finished "+s);
  }
}

aspect X {
  pointcut complicatedPointcut(): execution(* nonExistent(..)) && if(true==true);

  @SuppressAjWarnings("adviceDidNotMatch")
  before(): complicatedPointcut() {
    String s= "Hello";
    if (s.equals("five")) {
      int i = 5;
      System.out.println("Je suis ici "+i);
      i = i + 6;
      if (i==3) {
        String p2 = "foo";
      }
    } else {
      int j = 6;
      System.out.println("Ich bin hier "+j);
    }
    System.out.println("Finished "+s);
  }
}