You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Scenario2.aj 564B

1234567891011121314151617181920212223
  1. // "XLint warning: thisJoinPoint potentially lazy but stopped by around advice which doesn't use tjp"
  2. public aspect Scenario2 {
  3. public static boolean enabled = true;
  4. pointcut toBeTraced() : execution(* main(..));
  5. before () : toBeTraced() && if(enabled) {
  6. Object[] args = thisJoinPoint.getArgs(); // tjp not made lazily
  7. System.out.println(thisJoinPoint + ", arg's: " + args.length);
  8. }
  9. Object around() : toBeTraced() && if(enabled) {
  10. return proceed();
  11. }
  12. }
  13. class Test{
  14. static void main(String [] args){
  15. }
  16. }