Buggy code:
public class PointcutEvaluationExpenseComparator implements Comparator { private static final int MATCHES_NOTHING = - 1 ; private static final int WITHIN = 1 ; private static final int ATWITHIN = 2 ; private static final int STATICINIT = 3 ; private static final int ADVICEEXECUTION = 4 ; private static final int HANDLER = 5 ; private static final int GET_OR_SET = 6 ; private static final int WITHINCODE = 7 ; private static final int ATWITHINCODE = 8 ; private static final int EXE_INIT_PREINIT = 9 ; private static final int CALL = 10 ; private static final int ANNOTATION = 11 ; private static final int THIS_OR_TARGET = 12 ; private static final int AT_THIS_OR_TARGET = 13 ; private static final int ARGS = 14 ; private static final int AT_ARGS = 15 ; private static final int CFLOW = 16 ; private static final int IF = 17 ; private static final int OTHER = 20 ; public int compare ( Object o1 , Object o2 ) { } private int getScore ( Pointcut p ) { <START_BUG> if ( p . couldMatchKinds ( ) . isEmpty ( ) ) <END_BUG> return PointcutEvaluationExpenseComparator . MATCHES_NOTHING ; if ( p instanceof WithinPointcut ) return PointcutEvaluationExpenseComparator . WITHIN ; if ( p instanceof WithinAnnotationPointcut ) return PointcutEvaluationExpenseComparator . ATWITHIN ; if ( p instanceof KindedPointcut ) { KindedPointcut kp = ( ( KindedPointcut ) ( p ) ) ; Shadow . Kind kind = kp . getKind ( ) ; if ( kind == ( Shadow . AdviceExecution ) ) { return PointcutEvaluationExpenseComparator . ADVICEEXECUTION ; } else if ( ( kind == ( Shadow . ConstructorCall ) ) || ( kind == ( Shadow . MethodCall ) ) ) { return PointcutEvaluationExpenseComparator . CALL ; } else if ( ( ( ( kind == ( Shadow . ConstructorExecution ) ) || ( kind == ( Shadow . MethodExecution ) ) ) || ( kind == ( Shadow . Initialization ) ) ) || ( kind == ( Shadow . PreInitialization ) ) ) { return PointcutEvaluationExpenseComparator . EXE_INIT_PREINIT ; } else if ( kind == ( Shadow . ExceptionHandler ) ) { return PointcutEvaluationExpenseComparator . HANDLER ; } else if ( ( kind == ( Shadow . FieldGet ) ) || ( kind == ( Shadow . FieldSet ) ) ) { return PointcutEvaluationExpenseComparator . GET_OR_SET ; } else if ( kind == ( Shadow . StaticInitialization ) ) { return PointcutEvaluationExpenseComparator . STATICINIT ; } else return PointcutEvaluationExpenseComparator . OTHER ; } if ( p instanceof AnnotationPointcut ) return PointcutEvaluationExpenseComparator . ANNOTATION ; if ( p instanceof ArgsPointcut ) return PointcutEvaluationExpenseComparator . ARGS ; if ( p instanceof ArgsAnnotationPointcut ) return PointcutEvaluationExpenseComparator . AT_ARGS ; if ( p instanceof CflowPointcut ) return PointcutEvaluationExpenseComparator . CFLOW ; if ( p instanceof HandlerPointcut ) return PointcutEvaluationExpenseComparator . HANDLER ; if ( p instanceof IfPointcut ) return PointcutEvaluationExpenseComparator . IF ; if ( p instanceof ThisOrTargetPointcut ) return PointcutEvaluationExpenseComparator . THIS_OR_TARGET ; if ( p instanceof ThisOrTargetAnnotationPointcut ) return PointcutEvaluationExpenseComparator . AT_THIS_OR_TARGET ; if ( p instanceof WithincodePointcut ) return PointcutEvaluationExpenseComparator . WITHINCODE ; if ( p instanceof WithinCodeAnnotationPointcut ) return PointcutEvaluationExpenseComparator . ATWITHINCODE ; if ( p instanceof NotPointcut ) return getScore ( ( ( NotPointcut ) ( p ) ) . getNegatedPointcut ( ) ) ; if ( p instanceof AndPointcut ) return getScore ( ( ( AndPointcut ) ( p ) ) . getLeft ( ) ) ; if ( p instanceof OrPointcut ) return getScore ( ( ( OrPointcut ) ( p ) ) . getLeft ( ) ) ; return PointcutEvaluationExpenseComparator . OTHER ; } }

Fix:
if ( ( p . couldMatchKinds ( ) ) == ( Shadow . NO_SHADOW_KINDS_BITS ) )