Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

PrivateCall.java 652B

123456789101112131415161718192021222324252627282930
  1. // In this program, the around advice calls foo() and foo is a private static field in
  2. // class PrivateCall. When compiled the around() advice will be inlined and should call
  3. // foo() through an inline accessor method.
  4. public class PrivateCall {
  5. public void test () {foo("test");}
  6. private static void foo (String from) {
  7. System.err.print(":"+from);
  8. }
  9. public static void main(String[] args) {
  10. new PrivateCall().test();
  11. }
  12. private static aspect Aspect {
  13. pointcut execTest () :
  14. execution(* PrivateCall.test());
  15. before () : execTest () {
  16. foo("before");
  17. }
  18. void around () : execTest () {
  19. foo("around");
  20. }
  21. }
  22. }