Buggy code:
public abstract class AbstractImageBuilder implements ICompilerRequestor { protected JavaBuilder javaBuilder ; protected State newState ; protected NameEnvironment nameEnvironment ; protected ClasspathMultiDirectory [ ] sourceLocations ; protected BuildNotifier notifier ; protected Compiler compiler ; protected WorkQueue workQueue ; protected ArrayList problemSourceFiles ; protected boolean compiledAllAtOnce ; private boolean inCompiler ; protected SimpleSet filesWithAnnotations = null ; public static int MAX_AT_ONCE = 1000 ; public static final String [ ] JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES = new String [ ] { IMarker . MESSAGE , IMarker . SEVERITY , IJavaModelMarker . ID , IMarker . CHAR_START , IMarker . CHAR_END , IMarker . LINE_NUMBER , IJavaModelMarker . ARGUMENTS , IJavaModelMarker . CATEGORY_ID } ; public static final String [ ] JAVA_TASK_MARKER_ATTRIBUTE_NAMES = new String [ ] { IMarker . MESSAGE , IMarker . PRIORITY , IJavaModelMarker . ID , IMarker . CHAR_START , IMarker . CHAR_END , IMarker . LINE_NUMBER , IMarker . USER_EDITABLE } ; public static final Integer S_ERROR = new Integer ( IMarker . SEVERITY_ERROR ) ; public static final Integer S_WARNING = new Integer ( IMarker . SEVERITY_WARNING ) ; public static final Integer P_HIGH = new Integer ( IMarker . PRIORITY_HIGH ) ; public static final Integer P_NORMAL = new Integer ( IMarker . PRIORITY_NORMAL ) ; public static final Integer P_LOW = new Integer ( IMarker . PRIORITY_LOW ) ; protected AbstractImageBuilder ( JavaBuilder javaBuilder , boolean buildStarting , State newState ) { } public void acceptResult ( CompilationResult result ) { } protected void cleanUp ( ) { } protected void compile ( SourceFile [ ] units ) { } void compile ( SourceFile [ ] units , SourceFile [ ] additionalUnits ) { } protected void createProblemFor ( IResource resource , IMember javaElement , String message , String problemSeverity ) { } protected void deleteGeneratedFiles ( IFile [ ] deletedGeneratedFiles ) { } protected SourceFile findSourceFile ( IFile file ) { } protected void finishedWith ( String sourceLocator , CompilationResult result , char [ ] mainTypeName , ArrayList definedTypeNames , ArrayList duplicateTypeNames ) { } protected IContainer createFolder ( IPath packagePath , IContainer outputFolder ) throws CoreException { } protected RuntimeException internalException ( CoreException t ) { } protected boolean isExcludedFromProject ( IPath childPath ) throws JavaModelException { } protected Compiler newCompiler ( ) { } protected BuildContext [ ] notifyParticipants ( SourceFile [ ] unitsAboutToCompile ) { BuildContext [ ] results = new BuildContext [ unitsAboutToCompile . length ] ; for ( int i = unitsAboutToCompile . length ; ( -- i ) >= 0 ; ) results [ i ] = new BuildContext ( unitsAboutToCompile [ i ] ) ; for ( int i = 0 , l = this . javaBuilder . participants . length ; i < l ; i ++ ) this . javaBuilder . participants [ i ] . buildStarting ( results , ( ( this ) instanceof BatchImageBuilder ) ) ; SimpleSet uniqueFiles = null ; CompilationParticipantResult [ ] toAdd = null ; int added = 0 ; for ( int i = results . length ; ( -- i ) >= 0 ; ) { CompilationParticipantResult result = results [ i ] ; if ( result == null ) continue ; IFile [ ] deletedGeneratedFiles = result . deletedFiles ; if ( deletedGeneratedFiles != null ) deleteGeneratedFiles ( deletedGeneratedFiles ) ; IFile [ ] addedGeneratedFiles = result . addedFiles ; if ( addedGeneratedFiles != null ) { for ( int j = addedGeneratedFiles . length ; ( -- j ) >= 0 ; ) { SourceFile sourceFile = findSourceFile ( addedGeneratedFiles [ j ] ) ; if ( sourceFile == null ) continue ; if ( uniqueFiles == null ) { uniqueFiles = new SimpleSet ( ( ( unitsAboutToCompile . length ) + 3 ) ) ; for ( int f = unitsAboutToCompile . length ; ( -- f ) >= 0 ; ) uniqueFiles . add ( unitsAboutToCompile [ f ] ) ; } if ( ! ( uniqueFiles . includes ( sourceFile ) ) ) uniqueFiles . add ( sourceFile ) ; <START_BUG> CompilationParticipantResult newResult = new CompilationParticipantResult ( sourceFile ) ; <END_BUG> if ( toAdd == null ) { toAdd = new CompilationParticipantResult [ addedGeneratedFiles . length ] ; } else { int length = toAdd . length ; if ( added == length ) System . arraycopy ( toAdd , 0 , ( toAdd = new CompilationParticipantResult [ length + ( addedGeneratedFiles . length ) ] ) , 0 , length ) ; } toAdd [ ( added ++ ) ] = newResult ; } } } if ( added > 0 ) { int length = results . length ; System . arraycopy ( results , 0 , ( results = new BuildContext [ length + added ] ) , 0 , length ) ; System . arraycopy ( toAdd , 0 , results , length , added ) ; } return results ; } protected abstract void processAnnotationResults ( CompilationParticipantResult [ ] results ) { } protected void processAnnotations ( BuildContext [ ] results ) { } protected void recordParticipantResult ( CompilationParticipantResult result ) { } protected void storeProblemsFor ( SourceFile sourceFile , IProblem [ ] problems ) throws CoreException { } protected void storeTasksFor ( SourceFile sourceFile , IProblem [ ] tasks ) throws CoreException { } protected void updateProblemsFor ( SourceFile sourceFile , CompilationResult result ) throws CoreException { } protected void updateTasksFor ( SourceFile sourceFile , CompilationResult result ) throws CoreException { } protected char [ ] writeClassFile ( ClassFile classFile , SourceFile compilationUnit , boolean isSecondaryType ) throws CoreException { } protected void writeClassFileBytes ( byte [ ] bytes , IFile file , String qualifiedFileName , boolean isSecondaryType , boolean updateClassFile ) throws CoreException { } }

Fix:
CompilationParticipantResult newResult = new BuildContext ( sourceFile ) ;