mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-03 17:56:34 +02:00
20 lines
450 B
Plaintext
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){
|
|
}
|
|
}
|