summaryrefslogtreecommitdiffstats
path: root/tests/bugs/lazyTjpXLintWarning/Scenario2.aj
blob: fcc25a180a9a41ecd810b937a646996085998016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// "XLint warning: thisJoinPoint potentially lazy but stopped by around advice which doesn't use tjp"

public aspect Scenario2 {

    public static boolean enabled = true;

    pointcut toBeTraced() : execution(* main(..));

    before () : toBeTraced() && if(enabled) {
        Object[] args = thisJoinPoint.getArgs(); // tjp not made lazily
        System.out.println(thisJoinPoint + ", arg's: " + args.length);
    }

    Object around() : toBeTraced() && if(enabled) {
        return proceed();
    }
	
}

class Test{
  static void main(String [] args){
  }
}