blob: 000d47a7a080a08773f980f87b1d6d03fc623994 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// "no XLint warning: thisJoinPoint potentially lazy and nothing stopping it"
public aspect Scenario1 {
public static boolean enabled = true;
pointcut toBeTraced() : execution(* main(..));
before () : toBeTraced() && if(enabled) {
Object[] args = thisJoinPoint.getArgs(); // tjp made lazily
System.out.println(thisJoinPoint + ", arg's: " + args.length);
}
}
class Test{
static void main(String [] args){
}
}
|