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.

pr115237.aj 830B

12345678910111213141516171819202122232425262728293031323334353637
  1. public class pr115237 {
  2. public static void main(String[] args) {
  3. C c = new C();
  4. c.go();
  5. A a = A.aspectOf(c);
  6. // ok, illegal - aspectOf only on concrete aspects?
  7. // AA aa = AA.aspectOf(c);
  8. // hmm - n/a for parameterized types?
  9. B b = B.aspectOf(c);
  10. //BB capt = BB.aspectOf(c); // unexpected compile error here
  11. //System.out.println("A " + a + " capt " + capt);
  12. }
  13. static class C {
  14. void go() {}
  15. }
  16. abstract static aspect AA pertarget(pc()) {
  17. abstract pointcut pc();
  18. before() : pc() {
  19. System.out.println("go()");
  20. }
  21. }
  22. static aspect A extends AA {
  23. pointcut pc() : call(void C.go());
  24. }
  25. abstract static aspect BB<T> pertarget(pc()) {
  26. abstract pointcut pc();
  27. before() : pc() {
  28. System.out.println("go()");
  29. }
  30. }
  31. static aspect B extends BB<C> {
  32. pointcut pc() : call(void C.go());
  33. }
  34. }