| Summary: | wacky program causes unhelpful infinite loop | ||
|---|---|---|---|
| Product: | [Tools] AspectJ | Reporter: | Andrew Clement <aclement> |
| Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.6.9 | ||
| Target Milestone: | 1.6.9 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
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() |
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.