aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/lazyTjpXLintWarning/LazyTjpTest3.java
blob: 146fe3c1d0cbcbda5d603e3dfc007bde01d951b0 (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
public class LazyTjpTest3 {

  public void test1 () { }
  public void test2 () { }
  public void test3 () { }
  public void test4 () { }
  
  private static aspect Aspect1 {

    private static boolean enabled = true;
    
    // OK, has an if() but doesnt use tjp anyway!
    after () : if(enabled) && execution(public void LazyTjpTest3.test1()) {
    }

    // Not ok, cant apply because no if() used
    after () : execution(public void LazyTjpTest3.test2()) {
      System.out.println(thisJoinPoint);
    }

    // OK, doesnt use tjp
    after () : execution(public void LazyTjpTest3.test3()) {
    }

    // OK, uses tjp but also has if()
    after () : if(enabled) && execution(public void LazyTjpTest3.test4()) {
      System.err.println(thisJoinPoint);
    }
  }

}