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 ( ) { } protected void addDependentsOf ( IPath path , boolean hasStructuralChanges ) { } protected void cleanUp ( ) { } protected boolean findAffectedSourceFiles ( IResourceDelta delta , IResource prereqOutputFolder ) { } protected void findAffectedSourceFiles ( IResourceDelta binaryDelta , int outputFolderSegmentCount ) { } protected boolean findSourceFiles ( IResourceDelta delta ) throws CoreException { } protected void findSourceFiles ( IResourceDelta sourceDelta , int sourceFolderSegmentCount ) throws CoreException { IResource resource = sourceDelta . getResource ( ) ; IPath location = resource . getLocation ( ) ; switch ( resource . getType ( ) ) { case IResource . PROJECT : case IResource . FOLDER : switch ( sourceDelta . getKind ( ) ) { case IResourceDelta . ADDED : IPath addedPackagePath = location . removeFirstSegments ( sourceFolderSegmentCount ) ; IFolder addedPackageFolder = outputFolder . getFolder ( addedPackagePath ) ; if ( ! ( addedPackageFolder . exists ( ) ) ) addedPackageFolder . create ( true , true , null ) ; if ( JavaBuilder . DEBUG ) System . out . println ( ( "Add<seq2seq4repair_space>dependents<seq2seq4repair_space>of<seq2seq4repair_space>added<seq2seq4repair_space>package<seq2seq4repair_space>" + addedPackagePath ) ) ; addDependentsOf ( addedPackagePath , true ) ; case IResourceDelta . CHANGED : IResourceDelta [ ] children = sourceDelta . getAffectedChildren ( ) ; for ( int i = 0 , length = children . length ; i < length ; i ++ ) findSourceFiles ( children [ i ] , sourceFolderSegmentCount ) ; return ; case IResourceDelta . REMOVED : IPath removedPackagePath = location . removeFirstSegments ( sourceFolderSegmentCount ) ; IFolder removedPackageFolder = outputFolder . getFolder ( removedPackagePath ) ; for ( int i = 0 , length = sourceFolders . length ; i < length ; i ++ ) { if ( ( sourceFolders [ i ] . findMember ( removedPackagePath ) ) != null ) { if ( ! ( removedPackageFolder . exists ( ) ) ) removedPackageFolder . create ( true , true , null ) ; IResourceDelta [ ] removedChildren = sourceDelta . getAffectedChildren ( ) ; for ( int j = 0 , rlength = removedChildren . length ; j < rlength ; j ++ ) findSourceFiles ( removedChildren [ j ] , sourceFolderSegmentCount ) ; return ; } } if ( removedPackageFolder . exists ( ) ) removedPackageFolder . delete ( true , null ) ; if ( JavaBuilder . DEBUG ) System . out . println ( ( "Add<seq2seq4repair_space>dependents<seq2seq4repair_space>of<seq2seq4repair_space>removed<seq2seq4repair_space>package<seq2seq4repair_space>" + removedPackagePath ) ) ; addDependentsOf ( removedPackagePath , true ) ; newState . removePackage ( sourceDelta ) ; } return ; case IResource . FILE : String extension = location . getFileExtension ( ) ; if ( JAVA_EXTENSION . equalsIgnoreCase ( extension ) ) { IPath typePath = location . removeFirstSegments ( sourceFolderSegmentCount ) . removeFileExtension ( ) ; switch ( sourceDelta . getKind ( ) ) { case IResourceDelta . ADDED : if ( JavaBuilder . DEBUG ) System . out . println ( ( "Compile<seq2seq4repair_space>this<seq2seq4repair_space>added<seq2seq4repair_space>source<seq2seq4repair_space>file<seq2seq4repair_space>" + location ) ) ; locations . add ( location . toString ( ) ) ; typeNames . add ( typePath . setDevice ( null ) . toString ( ) ) ; if ( JavaBuilder . DEBUG ) System . out . println ( ( "Add<seq2seq4repair_space>dependents<seq2seq4repair_space>of<seq2seq4repair_space>added<seq2seq4repair_space>source<seq2seq4repair_space>file<seq2seq4repair_space>" + typePath ) ) ; addDependentsOf ( typePath , true ) ; return ; case IResourceDelta . REMOVED : char [ ] [ ] definedTypeNames = newState . getDefinedTypeNamesFor ( location . toString ( ) ) ; <START_BUG> if ( definedTypeNames == null ) { <END_BUG> removeClassFile ( typePath ) ; } else { IPath packagePath = typePath . removeLastSegments ( 1 ) ; for ( int i = 0 , length = definedTypeNames . length ; i < length ; i ++ ) removeClassFile ( packagePath . append ( new String ( definedTypeNames [ i ] ) ) ) ; } newState . remove ( location ) ; return ; case IResourceDelta . CHANGED : if ( ( ( sourceDelta . getFlags ( ) ) & ( IResourceDelta . CONTENT ) ) == 0 ) return ; if ( JavaBuilder . DEBUG ) System . out . println ( ( "Compile<seq2seq4repair_space>this<seq2seq4repair_space>changed<seq2seq4repair_space>source<seq2seq4repair_space>file<seq2seq4repair_space>" + location ) ) ; locations . add ( sourceDelta . getResource ( ) . getLocation ( ) . toString ( ) ) ; typeNames . add ( typePath . setDevice ( null ) . toString ( ) ) ; } return ; } else if ( CLASS_EXTENSION . equalsIgnoreCase ( extension ) ) { return ; } else if ( hasSeparateOutputFolder ) { IPath resourcePath = location . removeFirstSegments ( sourceFolderSegmentCount ) ; IResource outputFile = outputFolder . getFile ( resourcePath ) ; switch ( sourceDelta . getKind ( ) ) { case IResourceDelta . ADDED : if ( outputFile . exists ( ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( ( "Deleting<seq2seq4repair_space>existing<seq2seq4repair_space>file<seq2seq4repair_space>" + resourcePath ) ) ; outputFile . delete ( true , null ) ; } if ( JavaBuilder . DEBUG ) System . out . println ( ( "Copying<seq2seq4repair_space>added<seq2seq4repair_space>file<seq2seq4repair_space>" + resourcePath ) ) ; getOutputFolder ( resourcePath . removeLastSegments ( 1 ) ) ; resource . copy ( outputFile . getFullPath ( ) , true , null ) ; return ; case IResourceDelta . REMOVED : if ( outputFile . exists ( ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( ( "Deleting<seq2seq4repair_space>removed<seq2seq4repair_space>file<seq2seq4repair_space>" + resourcePath ) ) ; outputFile . delete ( true , null ) ; } return ; case IResourceDelta . CHANGED : if ( ( ( sourceDelta . getFlags ( ) ) & ( IResourceDelta . CONTENT ) ) == 0 ) return ;

Fix:
if ( ( definedTypeNames == null ) || ( ( definedTypeNames . length ) == 0 ) ) {