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.

CallsVRec.java 888B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import org.aspectj.compiler.base.ast.*;
  2. public class CallsVRec {
  3. public static void main(String[] args) {
  4. new CallsVRec().realMain(args);
  5. }
  6. public void realMain(String[] args) {
  7. org.aspectj.testing.Tester.check(true, "Compiled!");
  8. }
  9. public CallsVRec() {
  10. }
  11. }
  12. aspect Wins {
  13. pointcut showError(ASTObject ast, String msg):
  14. target(ast)
  15. && call(void ASTObject.showError(String))
  16. && args(msg);
  17. void around(ASTObject ast, String msg): showError(ast, msg) {
  18. System.out.println("hi");
  19. proceed(ast, msg);
  20. }
  21. }
  22. aspect Loses {
  23. pointcut showError(ASTObject ast, String msg):
  24. target(ast)
  25. && call/*s*/(void ASTObject.showError(String))
  26. && args(msg);
  27. void around(ASTObject ast, String msg): showError(ast, msg) {
  28. System.out.println("hi");
  29. proceed(ast, msg);
  30. }
  31. }