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.

Driver.java 585B

12345678910111213141516171819202122232425262728293031
  1. import org.aspectj.testing.Tester;
  2. public class Driver {
  3. public static void main(String[] args) { test(); }
  4. public static void test() {
  5. C c = new C();
  6. Tester.checkEqual(c.basic(), 4, "basic()");
  7. Tester.checkEqual(c.exceptional(), 3, "exceptional()");
  8. }
  9. }
  10. class C {
  11. public int basic() {
  12. return 1;
  13. }
  14. public int exceptional() {
  15. return 1;
  16. }
  17. }
  18. aspect B {
  19. int around(): target(C) && call(int basic()) {
  20. return 4;
  21. }
  22. int around(): target(C) && call(int exceptional()) {
  23. return 3;
  24. }
  25. }