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.

PointcutQualification2.java 768B

123456789101112131415161718192021222324252627282930313233
  1. import org.aspectj.testing.Tester;
  2. public class PointcutQualification2 {
  3. public static void main(String[] args) {
  4. Tester.expectEvent("before pc_reference2");
  5. new TargetClass().doit();
  6. Tester.checkAllEvents();
  7. }
  8. }
  9. class I {
  10. public static final void got(String s) {
  11. Tester.event(s);
  12. }
  13. }
  14. class TargetClass{ void doit(){}}
  15. aspect DebugAspect2 { // incorrect compiler error here
  16. before() : Aspect2.pc_reference2() { I.got("before pc_reference2");}
  17. }
  18. aspect Aspect2 {
  19. pointcut pc_notfound2()
  20. : execution(void TargetClass.doit()) ;
  21. //pointcut anotherRef() : Aspect2.pc_notfound2(); // workaround
  22. pointcut anotherRef() : pc_notfound2();
  23. pointcut pc_reference2() : anotherRef();
  24. }