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.

PrivateCall2.java 678B

123456789101112131415161718192021222324
  1. package abc;
  2. // This time, the around advice calls the private static method foo but the around advice
  3. // will be inlined into a type in a different package (PrivateCall3). This should work
  4. // as the around advice will call back to the aspect which will call on to foo().
  5. public class PrivateCall2 {
  6. public void test () {foo("test");}
  7. private static void foo (String from) {
  8. System.err.print(":"+from);
  9. }
  10. public static void main(String[] args) {
  11. new PrivateCall2().test();
  12. }
  13. private static aspect Aspect {
  14. pointcut execTest () : execution(* test());
  15. before () : execTest () { foo("before"); }
  16. void around () : execTest () { foo("around"); }
  17. }
  18. }