Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Oxford.java 641B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* initialisers of intertype fields should match field set pointcuts.
  2. In the example below, the output should be
  3. set field set(int C.n)
  4. set field set(int C.m)
  5. get field get(int C.n)
  6. set field set(int C.n)
  7. but the first field set (of C.n) is not picked up.
  8. */
  9. aspect Aspect {
  10. private int C.n = 13;
  11. before() : get(* C.*) {
  12. System.err.print(":get field "+thisJoinPointStaticPart);
  13. }
  14. before() : set(* C.*) {
  15. System.err.print(":set field "+thisJoinPointStaticPart);
  16. }
  17. public void C.foo() {
  18. n++;
  19. }
  20. }
  21. class C {
  22. int m = 20;
  23. }
  24. public class Oxford {
  25. public static void main(String[] args) {
  26. C c = new C();
  27. c.foo();
  28. }
  29. }