mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-27 17:54:40 +02:00
31 lines
751 B
Java
31 lines
751 B
Java
![]() |
public class LazyTjpTest2 {
|
||
|
|
||
|
public void test1 () { }
|
||
|
public void test2 () { }
|
||
|
public void test3 () { }
|
||
|
|
||
|
private static aspect Aspect1 {
|
||
|
|
||
|
private static boolean enabled = true;
|
||
|
|
||
|
// OK, has an if() but doesnt use tjp anyway!
|
||
|
before () : if(enabled) && execution(public void LazyTjpTest2.test1()) {
|
||
|
}
|
||
|
|
||
|
// Not ok, cant apply because no if() used
|
||
|
before () : execution(public void LazyTjpTest2.test2()) {
|
||
|
System.out.println(thisJoinPoint);
|
||
|
}
|
||
|
|
||
|
// OK, doesnt use tjp
|
||
|
before () : execution(public void LazyTjpTest2.test3()) {
|
||
|
}
|
||
|
|
||
|
// OK, uses tjp but also has if()
|
||
|
before () : if(enabled) && execution(public void LazyTjpTest2.test1()) {
|
||
|
System.err.println(thisJoinPoint);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|