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.

pr115250.aj 722B

123456789101112131415161718192021222324252627282930313233343536
  1. public class pr115250 {
  2. public static void main(String[] args) {
  3. test();
  4. }
  5. public static void test() {
  6. new C();
  7. }
  8. static class C {
  9. C() {
  10. System.err.println("C.new() running");
  11. }
  12. }
  13. // properly get compiler error wrt return type of join point
  14. static aspect Normal {
  15. C around() : execution(C.new()) {
  16. return proceed();
  17. }
  18. }
  19. // no compiler error wrt return type of join point
  20. static abstract aspect SS<Target> {
  21. abstract protected pointcut creation();
  22. Target around() : creation() { // expect CE for execution(C.new());
  23. System.err.println("Advice running");
  24. return proceed();
  25. }
  26. }
  27. static aspect A extends SS<C> {
  28. protected pointcut creation() : execution(C.new());
  29. }
  30. }