org.aspectj/tests/bugs/lazyTjpXLintWarning/Scenario1.aj
2005-10-31 15:53:24 +00:00

20 lines
450 B
Plaintext

// "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){
}
}