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.

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