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.

PrivateCallInstance.java 601B

123456789101112131415161718192021222324252627
  1. // Similar to PrivateCall but now foo() is a private non-static method.
  2. public class PrivateCallInstance {
  3. public void test () {foo("test");}
  4. private void foo (String from) {
  5. System.err.print(":"+from);
  6. }
  7. public static void main(String[] args) {
  8. new PrivateCallInstance().test();
  9. }
  10. private static aspect Aspect {
  11. pointcut execTest (PrivateCallInstance s) :
  12. execution(* PrivateCallInstance.test()) && target(s);
  13. before (PrivateCallInstance s) : execTest (s) {
  14. s.foo("before");
  15. }
  16. void around (PrivateCallInstance s) : execTest (s) {
  17. s.foo("around");
  18. }
  19. }
  20. }