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.

AbstractAspectsExtendingAbstractAspectsGeneratesMethodsWithTheSameName_PR464.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import org.aspectj.testing.Tester;
  2. public class AbstractAspectsExtendingAbstractAspectsGeneratesMethodsWithTheSameName_PR464 {
  3. public static void main(String[] args) {
  4. new AbstractAspectsExtendingAbstractAspectsGeneratesMethodsWithTheSameName_PR464().realMain(args);
  5. }
  6. public void realMain(String[] args) {
  7. new C().c();
  8. // No tests to actually run. The point is that all advice is abstract!
  9. //Tester.checkAllEvents();
  10. }
  11. static {
  12. //Tester.expectEventsInString("AspectA.star,AspectA.c");
  13. //Tester.expectEventsInString("AspectB.star,AspectB.c");
  14. //Tester.expectEventsInString("AspectC.star,AspectC.c");
  15. }
  16. }
  17. class C {
  18. public void c() {}
  19. }
  20. abstract aspect AspectA {
  21. before() : execution(* *(..)) {
  22. Tester.event("AspectA.star");
  23. }
  24. before() : execution(* c(..)) {
  25. Tester.event("AspectA.c");
  26. }
  27. }
  28. abstract aspect AspectB extends AspectA {
  29. before() : execution(* *(..)) {
  30. Tester.event("AspectB.star");
  31. }
  32. before() : execution(* c(..)) {
  33. Tester.event("AspectB.c");
  34. }
  35. }
  36. abstract aspect AspectC extends AspectB {
  37. before() : execution(* *(..)) {
  38. Tester.event("AspectC.star");
  39. }
  40. before() : execution(* c(..)) {
  41. Tester.event("AspectC.c");
  42. }
  43. }