Buggy code:
public class Compiler implements ITypeRequestor , ProblemSeverities { public Parser parser ; public ICompilerRequestor requestor ; public CompilerOptions options ; public ProblemReporter problemReporter ; protected PrintWriter out ; public CompilationUnitDeclaration [ ] unitsToProcess ; public int totalUnits ; public LookupEnvironment lookupEnvironment ; public static boolean DEBUG = false ; public int parseThreshold = - 1 ; public AbstractAnnotationProcessorManager annotationProcessorManager ; public ReferenceBinding [ ] referenceBindings ; public static IDebugRequestor DebugRequestor = null ; public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory , boolean parseLiteralExpressionsAsConstants ) { } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , CompilerOptions options , final ICompilerRequestor requestor , IProblemFactory problemFactory , PrintWriter out ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } public void accept ( ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding , AccessRestriction accessRestriction ) { } protected void addCompilationUnit ( ICompilationUnit sourceUnit , CompilationUnitDeclaration parsedUnit ) { } protected void beginToCompile ( ICompilationUnit [ ] sourceUnits ) { } public void compile ( ICompilationUnit [ ] sourceUnits ) { } public void setBinaryTypes ( ReferenceBinding [ ] binaryTypes ) { } protected void handleInternalException ( Throwable internalException , CompilationUnitDeclaration unit , CompilationResult result ) { } protected void handleInternalException ( org . eclipse . jdt . internal . compiler . problem . AbortCompilation abortException , CompilationUnitDeclaration unit ) { } public void initializeParser ( ) { } protected void internalBeginToCompile ( ICompilationUnit [ ] sourceUnits , int maxUnits ) { } public void process ( CompilationUnitDeclaration unit , int i ) { } protected void processAnnotations ( ) { int newUnitSize = 0 ; int newClassFilesSize = 0 ; int bottom = 0 ; int top = this . unitsToProcess . length ; ReferenceBinding [ ] binaryTypeBindingsTemp = this . referenceBindings ; if ( ( top == 0 ) && ( binaryTypeBindingsTemp == null ) ) return ; this . referenceBindings = null ; do { int length = top - bottom ; CompilationUnitDeclaration [ ] currentUnits = new CompilationUnitDeclaration [ length ] ; int index = 0 ; for ( int i = bottom ; i < top ; i ++ ) { CompilationUnitDeclaration currentUnit = this . unitsToProcess [ i ] ; if ( ( ( currentUnit . bits ) & ( ASTNode . IsImplicitUnit ) ) == 0 ) { currentUnits [ ( index ++ ) ] = currentUnit ; } } if ( index != length ) { System . arraycopy ( currentUnits , 0 , ( currentUnits = new CompilationUnitDeclaration [ index ] ) , 0 , index ) ; } this . annotationProcessorManager . processAnnotations ( currentUnits , binaryTypeBindingsTemp , false ) ; ICompilationUnit [ ] newUnits = this . annotationProcessorManager . getNewUnits ( ) ; newUnitSize = newUnits . length ; ReferenceBinding [ ] newClassFiles = this . annotationProcessorManager . getNewClassFiles ( ) ; binaryTypeBindingsTemp = newClassFiles ; newClassFilesSize = newClassFiles . length ; if ( newUnitSize != 0 ) { internalBeginToCompile ( newUnits , newUnitSize ) ; bottom = top ; <START_BUG> top = this . unitsToProcess . length ; <END_BUG> } else { bottom = top ; } this . annotationProcessorManager . reset ( ) ; } while ( ( newUnitSize != 0 ) || ( newClassFilesSize != 0 ) ) ; this . annotationProcessorManager . processAnnotations ( null , null , true ) ; } public void reset ( ) { } public CompilationUnitDeclaration resolve ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { } public CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { } }

Fix:
top = this . totalUnits ;