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.

SuperStaticCallJoinPoint.java 512B

12345678910111213141516171819202122232425
  1. import org.aspectj.testing.Tester;
  2. class Sup {
  3. static void m() {}
  4. }
  5. public class SuperStaticCallJoinPoint extends Sup {
  6. static boolean ran = false;
  7. public static void main(String[] args) {
  8. new SuperStaticCallJoinPoint().foo();
  9. Tester.check(ran, "didn't run advice");
  10. }
  11. void foo() {
  12. super.m();
  13. }
  14. static void m() {
  15. throw new RuntimeException();
  16. }
  17. }
  18. aspect A {
  19. before(): this(SuperStaticCallJoinPoint) && call(void Sup.m()) {
  20. SuperStaticCallJoinPoint.ran = true;
  21. }
  22. }