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.

AroundVarBug.java 942B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import java.util.*;
  2. import org.aspectj.testing.Tester;
  3. /** @testcase PR#456 advice on advice in usejavac mode */
  4. public aspect AroundVarBug {
  5. static {
  6. Tester.expectEvent("Meta-advice reached");
  7. Tester.expectEvent("advice reached");
  8. }
  9. protected pointcut iterator () :
  10. call (public Iterator Collection.iterator ());
  11. Iterator around () : iterator () {
  12. return handleIterator (thisJoinPoint, proceed ());
  13. }
  14. private Iterator handleIterator (Object join, Iterator iter) {
  15. Tester.event("advice reached");
  16. return iter;
  17. }
  18. // -------------
  19. // Meta-advice
  20. // -------------
  21. private pointcut adviceHandlers ():
  22. call (private * AroundVarBug.handle*(..));
  23. // Advice on this aspect!
  24. Object around () : adviceHandlers () {
  25. Tester.event("Meta-advice reached");
  26. return proceed();
  27. }
  28. } // end of aspect AroundVarBug