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.

AroundA.java 477B

123456789101112131415161718192021222324252627
  1. aspect AroundA {
  2. pointcut foo(): execution(void main(..));
  3. int around(int i, boolean b): args(i, b) && foo() {
  4. System.out.println("enter");
  5. return proceed(10, false);
  6. }
  7. void around(Object a): args(a) && foo() {
  8. System.out.println("enter");
  9. proceed("new: " + a);
  10. System.out.println("exit");
  11. }
  12. void around(final String[] a): args(a) && foo() {
  13. Runnable r = new Runnable() {
  14. public void run() {
  15. proceed(a);
  16. }
  17. };
  18. r.run();
  19. r.run();
  20. }
  21. }