Community
Participate
Working Groups
reported on the list by Eric Tanter: 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()); } } package test; public class Main { private static int plus(int first, int second){ return first + second; } public static void main(String[] args) { int num = plus(42,13); System.out.println(num); } } this loops infinitely unless the commented out section is uncommented.
test and fix committed. adjusted pointcut sorting order to make cflow ahead of if. We were failing to consider the 'ConcreteCflowPointcut' class in PointcutEvaluationExpenseComparator.getScore()