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.

Initialization.java 795B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. public class Initialization extends Super {
  2. public static void main(String[] args) {
  3. new Initialization();
  4. new Initialization(331);
  5. }
  6. Initialization() {
  7. this(98);
  8. }
  9. Initialization(int i) {
  10. super(i+1);
  11. foo(i);
  12. }
  13. static void foo(int i) {
  14. System.out.println("running foo with " + i);
  15. }
  16. }
  17. class Super {
  18. Super(int i) {
  19. }
  20. }
  21. aspect Foo {
  22. // void around(int i): initialization(Initialization.new(int)) && args(i) {
  23. // System.out.println(thisJoinPoint);
  24. // System.out.println(java.util.Arrays.asList(thisJoinPoint.getArgs()));
  25. // proceed(993);
  26. // }
  27. //
  28. Object around(): preinitialization(Initialization.new()) {
  29. System.out.println("i");
  30. return null;
  31. }
  32. // before(int i): execution(Initialization.new(int)) && args(i) {
  33. // System.err.println(i);
  34. // }
  35. }