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.

pr101047.aj 646B

123456789101112131415161718192021222324252627282930
  1. aspect Test {
  2. before() : ( execution(* Foo.foo(..) ) ) {
  3. System.out.println("before");
  4. }
  5. }
  6. class Foo {
  7. private String myString = "A String";
  8. public static void main(String[] args) {
  9. new Foo().foo();
  10. }
  11. private void foo() {
  12. String myLocal = myString;
  13. if (myLocal.endsWith("X")) {
  14. String local1 = "local1";
  15. System.out.println(local1);
  16. } else if (myLocal.endsWith("Y")) {
  17. String local2 = "local2";
  18. System.out.println(local2);
  19. } else {
  20. String local1 = "local3";
  21. System.out.println(local1);
  22. }
  23. }
  24. }