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.

IncompatibleClassChangeErrorBug.java 991B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import org.aspectj.testing.Tester;
  2. import org.aspectj.lang.*;
  3. import org.aspectj.lang.reflect.*;
  4. /** @testcase PR#901 IncompatibleClassChangeError bug */
  5. public class IncompatibleClassChangeErrorBug {
  6. public static void main(String[] args) {
  7. Tester.expectEvent("printed");
  8. method1();
  9. Tester.checkAllEvents();
  10. }
  11. public static void method1() {
  12. }
  13. }
  14. aspect JoinpointTestAspect {
  15. before() : call(static void method1()) {
  16. printArgs(thisJoinPoint);
  17. // This call is required to reproduce the bug...
  18. printStaticInfo(thisJoinPointStaticPart);
  19. }
  20. private void printArgs(JoinPoint joinPoint) {
  21. Object[] args = joinPoint.getArgs();
  22. // While the original code had a for() loop to print arguments
  23. // bug can be seen without it...
  24. }
  25. private void printStaticInfo(JoinPoint.StaticPart
  26. joinPointStaticPart) {
  27. Tester.check(null != joinPointStaticPart, "null parm");
  28. Tester.event("printed");
  29. }
  30. }