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.

LazyTjpTest2.java 751B

123456789101112131415161718192021222324252627282930
  1. public class LazyTjpTest2 {
  2. public void test1 () { }
  3. public void test2 () { }
  4. public void test3 () { }
  5. private static aspect Aspect1 {
  6. private static boolean enabled = true;
  7. // OK, has an if() but doesnt use tjp anyway!
  8. before () : if(enabled) && execution(public void LazyTjpTest2.test1()) {
  9. }
  10. // Not ok, cant apply because no if() used
  11. before () : execution(public void LazyTjpTest2.test2()) {
  12. System.out.println(thisJoinPoint);
  13. }
  14. // OK, doesnt use tjp
  15. before () : execution(public void LazyTjpTest2.test3()) {
  16. }
  17. // OK, uses tjp but also has if()
  18. before () : if(enabled) && execution(public void LazyTjpTest2.test1()) {
  19. System.err.println(thisJoinPoint);
  20. }
  21. }
  22. }