blob: 2672a465edd462a4538f82f0556f491af11ba26a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package test;
public aspect Profiling {
pointcut profile(): execution(* *.*(..)) ;
private pointcut scope() :
if(condition())
//&& !(execution(* *.condition())) <- uncomment and infinite loop disappears
&& !cflow(execution(* *.condition()));
public static boolean condition(){
return (Math.random()<2); //always true
}
before(): profile() && scope() {
System.out.println("Entering method "+thisJoinPointStaticPart.getSignature());
}
}
|