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.

AroundCasting.java 554B

123456789101112131415161718192021222324
  1. import org.aspectj.testing.Tester;
  2. public class AroundCasting {
  3. public static void main(String[] args) {
  4. Tester.checkEqual(x = 3, 3);
  5. Tester.checkEqual(x, 1003);
  6. Tester.checkEvents(new String[] { "enter main" });
  7. }
  8. static int x;
  9. }
  10. aspect A {
  11. static boolean test() { return true; }
  12. int around(): if (test()) && get(int AroundCasting.x) {
  13. return proceed() + 1000;
  14. }
  15. void around(): execution(void AroundCasting.main(String[])) {
  16. Tester.event("enter main");
  17. proceed();
  18. }
  19. }