Buggy code:
public class IncrementalImageBuilder extends AbstractImageBuilder { protected ArrayList sourceFiles ; protected ArrayList previousSourceFiles ; protected StringSet qualifiedStrings ; protected StringSet simpleStrings ; protected SimpleLookupTable secondaryTypesToRemove ; protected boolean hasStructuralChanges ; protected int compileLoop ; protected boolean makeOutputFolderConsistent ; public static int MaxCompileLoop = 5 ; protected IncrementalImageBuilder ( JavaBuilder javaBuilder , State buildState ) { } protected IncrementalImageBuilder ( JavaBuilder javaBuilder ) { } protected IncrementalImageBuilder ( BatchImageBuilder batchBuilder ) { } public boolean build ( SimpleLookupTable deltas ) { } protected void buildAfterBatchBuild ( ) { } protected void addAffectedSourceFiles ( ) { } protected void addAffectedSourceFiles ( char [ ] secondaryTypeName ) { int index = CharOperation . lastIndexOf ( '//' , secondaryTypeName ) ; <START_BUG> String packageName = ( index == ( - 1 ) ) ? null : new String ( CharOperation . subarray ( secondaryTypeName , 0 , index ) ) ; <END_BUG> StringSet packageNames = new StringSet ( 1 ) ; packageNames . add ( packageName ) ; String typeName = new String ( ( index == ( - 1 ) ? secondaryTypeName : CharOperation . subarray ( secondaryTypeName , ( index + 1 ) , secondaryTypeName . length ) ) ) ; StringSet typeNames = new StringSet ( 1 ) ; typeNames . add ( typeName ) ; addAffectedSourceFiles ( packageNames , typeNames ) ; } private void addAffectedSourceFiles ( StringSet qualifiedSet , StringSet simpleSet ) { } protected void addDependentsOf ( IPath path , boolean isStructuralChange ) { } protected boolean checkForClassFileChanges ( IResourceDelta binaryDelta , ClasspathMultiDirectory md , int segmentCount ) throws CoreException { } protected void cleanUp ( ) { } protected void deleteGeneratedFiles ( IFile [ ] deletedGeneratedFiles ) { } protected boolean findAffectedSourceFiles ( IResourceDelta delta , ClasspathLocation [ ] classFoldersAndJars , IProject prereqProject ) { } protected void findAffectedSourceFiles ( IResourceDelta binaryDelta , int segmentCount , StringSet structurallyChangedTypes ) { } protected boolean findSourceFiles ( IResourceDelta delta ) throws CoreException { } protected boolean findSourceFiles ( IResourceDelta sourceDelta , ClasspathMultiDirectory md , int segmentCount ) throws CoreException { } protected void finishedWith ( String sourceLocator , CompilationResult result , char [ ] mainTypeName , ArrayList definedTypeNames , ArrayList duplicateTypeNames ) { } protected void processAnnotationResults ( CompilationParticipantResult [ ] results ) { } protected void removeClassFile ( IPath typePath , IContainer outputFolder ) throws CoreException { } protected void removeSecondaryTypes ( ) throws CoreException { } protected void resetCollections ( ) { } protected void updateProblemsFor ( SourceFile sourceFile , CompilationResult result ) throws CoreException { } protected void updateTasksFor ( SourceFile sourceFile , CompilationResult result ) throws CoreException { } protected void writeClassFileBytes ( byte [ ] bytes , IFile file , String qualifiedFileName , boolean isTopLevelType , boolean updateClassFile ) throws CoreException { } protected boolean writeClassFileCheck ( IFile file , String fileName , byte [ ] newBytes ) throws CoreException { } public String toString ( ) { } }

Fix:
String packageName = ( index == ( - 1 ) ) ? "" : new String ( CharOperation . subarray ( secondaryTypeName , 0 , index ) ) ;