您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }