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.

Scenario1.aj 450B

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