Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

NoCalledMethodName.java 567B

123456789101112131415161718192021222324
  1. import org.aspectj.testing.*;
  2. /*
  3. * Advice is not getting the calledMethodName.
  4. */
  5. public class NoCalledMethodName {
  6. public static void main(String[] args) {
  7. new NoCalledMethodName().go(args);
  8. }
  9. void go(String[] args) {
  10. Tester.check("Go was called");
  11. }
  12. }
  13. aspect NoCalledMethodNameAspect of eachobject(instanceof(NoCalledMethodName)) {
  14. pointcut p2(NoCalledMethodName f): receptions(void go(..)) && instanceof(f);
  15. around(NoCalledMethodName f) returns void: p2(f) {
  16. String s = thisJoinPoint.methodName;
  17. }
  18. }