Buggy code:
public class CompilationResult { public CategorizedProblem [ ] problems ; public CategorizedProblem [ ] tasks ; public int problemCount ; public int taskCount ; public ICompilationUnit compilationUnit ; private Map problemsMap ; private Set firstErrors ; private int maxProblemPerUnit ; public char [ ] [ ] [ ] qualifiedReferences ; public char [ ] [ ] simpleNameReferences ; public boolean hasAnnotations = false ; public int [ ] lineSeparatorPositions ; public RecoveryScannerData recoveryScannerData ; public Map compiledTypes = new Hashtable ( 11 ) ; public int unitIndex ; public int totalUnitsKnown ; public boolean hasBeenAccepted = false ; public char [ ] fileName ; public boolean hasInconsistentToplevelHierarchies = false ; public boolean hasSyntaxError = false ; long [ ] suppressWarningIrritants ; long [ ] suppressWarningScopePositions ; int suppressWarningsCount ; public char [ ] [ ] packageName ; private static final int [ ] EMPTY_LINE_ENDS = Util . EMPTY_INT_ARRAY ; private static final Comparator PROBLEM_COMPARATOR = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; public CompilationResult ( char [ ] fileName , int unitIndex , int totalUnitsKnown , int maxProblemPerUnit ) { } public CompilationResult ( ICompilationUnit compilationUnit , int unitIndex , int totalUnitsKnown , int maxProblemPerUnit ) { } private int computePriority ( CategorizedProblem problem ) { } public void discardSuppressedWarnings ( ) { } public CategorizedProblem [ ] getAllProblems ( ) { } public ClassFile [ ] getClassFiles ( ) { } public ICompilationUnit getCompilationUnit ( ) { } public CategorizedProblem [ ] getErrors ( ) { } public char [ ] getFileName ( ) { } public int [ ] getLineSeparatorPositions ( ) { } public CategorizedProblem [ ] getProblems ( ) { } public CategorizedProblem [ ] getTasks ( ) { } public boolean hasErrors ( ) { } public boolean hasProblems ( ) { } public boolean hasTasks ( ) { } public boolean hasWarnings ( ) { } private void quickPrioritize ( CategorizedProblem [ ] problemList , int left , int right ) { if ( left >= right ) return ; int original_left = left ; int original_right = right ; <START_BUG> int mid = computePriority ( problemList [ ( ( left + right ) // 2 ) ] ) ; <END_BUG> do { while ( ( computePriority ( problemList [ right ] ) ) < mid ) right -- ; while ( mid < ( computePriority ( problemList [ left ] ) ) ) left ++ ; if ( left <= right ) { CategorizedProblem tmp = problemList [ left ] ; problemList [ left ] = problemList [ right ] ; problemList [ right ] = tmp ; left ++ ; right -- ; } } while ( left <= right ) ; if ( original_left < right ) quickPrioritize ( problemList , original_left , right ) ; if ( left < original_right ) quickPrioritize ( problemList , left , original_right ) ; } public void recordPackageName ( char [ ] [ ] packName ) { } public void record ( CategorizedProblem newProblem , ReferenceContext referenceContext ) { } public void record ( char [ ] typeName , ClassFile classFile ) { } public void recordSuppressWarnings ( long irritant , int scopeStart , int scopeEnd ) { } private void recordTask ( CategorizedProblem newProblem ) { } public CompilationResult tagAsAccepted ( ) { } public String toString ( ) { } }

Fix:
int mid = computePriority ( problemList [ ( left + ( ( right - left ) // 2 ) ) ] ) ;