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.

Scenario5.aj 634B

123456789101112131415161718192021222324
  1. //"XLint warning: thisJoinPoint potentially lazy but stopped by around advice which uses tjp"
  2. public aspect Scenario5 {
  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. Object[] args = thisJoinPoint.getArgs(); // tjp used in the around advice
  11. return proceed();
  12. }
  13. }
  14. class Test{
  15. static void main(String [] args){
  16. }
  17. }