Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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. }