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.

ThisJoinPointAndVerifier.java 796B

12345678910111213141516171819202122232425262728
  1. /** Bugzilla Bug 34210
  2. thisJoinPoint.getArgs() causes IncompatibleClassChangeError */
  3. public class ThisJoinPointAndVerifier {
  4. public void method() {
  5. System.out.println("Executed method");
  6. }
  7. public static void main(String args[]) {
  8. ThisJoinPointAndVerifier td = new ThisJoinPointAndVerifier();
  9. td.method();
  10. }
  11. }
  12. aspect Log1 {
  13. pointcut logged_method() :
  14. call(* ThisJoinPointAndVerifier.*(..));
  15. after() : logged_method() {
  16. Object[] args = thisJoinPoint.getArgs();
  17. System.out.println ("Log1a: leaving " + thisJoinPoint.getSignature());
  18. }
  19. // comment this advice for scenario 2
  20. after() : logged_method() {
  21. //VM crash on scenario 1
  22. //Object[] args = thisJoinPoint.getArgs();
  23. System.out.println ("Log1b: leaving " + thisJoinPoint.getSignature());
  24. }
  25. }