summaryrefslogtreecommitdiffstats
path: root/tests/bugs1612/pr239649/Three.java
blob: 144902e5ac41543c216840f69e16d6de326fade2 (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 Three {
  public static void main(String[] argv) {
    Three a = new Three();
    a.m();
    a.m();
    a.m();
    a.m();
  }

  public void m() {
    System.out.println("Method m() running");
  }
}

aspect X {
  int count = 0;

  boolean doit() {
    count++;
    System.out.println("In instance check method, count="+count+" so doit returns "+((count%2)==0));
    return (count%2)==0;
  }

  after():call(* m(..))  && if(thisAspectInstance.doit()){ 
    System.out.println("In advice()");
  }
}