Buggy code:
public class IncrementalImageBuilder extends AbstractImageBuilder { protected ArrayList locations ; protected ArrayList previousLocations ; protected ArrayList typeNames ; protected ArrayList qualifiedStrings ; protected ArrayList simpleStrings ; public static int MaxCompileLoop = 5 ; protected IncrementalImageBuilder ( JavaBuilder javaBuilder ) { } public boolean build ( SimpleLookupTable deltas ) { } protected void addAffectedSourceFiles ( ) { if ( ( qualifiedStrings . isEmpty ( ) ) && ( simpleStrings . isEmpty ( ) ) ) return ; char [ ] [ ] [ ] qualifiedNames = ReferenceCollection . internQualifiedNames ( qualifiedStrings ) ; if ( ( qualifiedNames . length ) < ( qualifiedStrings . size ( ) ) ) qualifiedNames = null ; char [ ] [ ] simpleNames = ReferenceCollection . internSimpleNames ( simpleStrings ) ; if ( ( simpleNames . length ) < ( simpleStrings . size ( ) ) ) simpleNames = null ; Object [ ] keyTable = references . keyTable ; Object [ ] valueTable = references . valueTable ; next : for ( int i = 0 , l = keyTable . length ; i < l ; i ++ ) { String location = ( ( String ) ( keyTable [ i ] ) ) ; if ( location != null ) { if ( ( ( compiledAllAtOnce ) && ( ( previousLocations ) != null ) ) && ( previousLocations . contains ( location ) ) ) continue next ; if ( locations . contains ( location ) ) continue next ; ReferenceCollection refs = ( ( ReferenceCollection ) ( valueTable [ i ] ) ) ; if ( refs . includes ( qualifiedNames , simpleNames ) ) { IResource affectedFile = workspaceRoot . getFileForLocation ( new Path ( location ) ) ; if ( ( affectedFile != null ) && ( affectedFile . exists ( ) ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( ( "<seq2seq4repair_space>adding<seq2seq4repair_space>affected<seq2seq4repair_space>source<seq2seq4repair_space>file<seq2seq4repair_space>" + location ) ) ; locations . add ( location ) ; for ( int j = 0 , k = sourceFolders . length ; j < k ; j ++ ) { String sourceLocation = sourceFolders [ j ] . getLocation ( ) . toString ( ) ; if ( location . startsWith ( sourceLocation ) ) { <START_BUG> typeNames . add ( location . substring ( sourceLocation . length ( ) , ( ( location . length ( ) ) - 5 ) ) ) ; <END_BUG> continue next ; } } typeNames . add ( location ) ; } } } } } protected void addDependentsOf ( IPath path , boolean hasStructuralChanges ) { } protected boolean canRemovePackage ( IPath removedPackagePath ) { } protected void cleanUp ( ) { } protected void findAffectedSourceFiles ( IResourceDelta delta , IResource prereqOutputFolder ) { } protected void findAffectedSourceFiles ( IResourceDelta binaryDelta , int outputFolderSegmentCount ) { } protected void findSourceFiles ( IResourceDelta delta ) throws CoreException { } protected void findSourceFiles ( IResourceDelta sourceDelta , int sourceFolderSegmentCount ) throws CoreException { } protected void finishedWith ( String location , CompilationResult result , char [ ] [ ] additionalTypeNames ) throws CoreException { } protected boolean isClassFileChanged ( IFile file , String fileName , byte [ ] newBytes , boolean isSecondaryType ) throws CoreException { } protected void resetCollections ( ) { } protected void updateProblemsFor ( CompilationResult result ) { } public String toString ( ) { } }

Fix:
typeNames . add ( location . substring ( ( ( sourceLocation . length ( ) ) + 1 ) , ( ( location . length ( ) ) - 5 ) ) ) ;