Buggy code:
public class IndexBinaryFolder extends IndexRequest { IFolder folder ; public IndexBinaryFolder ( IFolder folder , IndexManager manager ) { } public boolean equals ( Object o ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( this . isCancelled ) || ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) ) return true ; if ( ! ( this . folder . isAccessible ( ) ) ) return true ; <START_BUG> IIndex index = this . manager . getIndex ( this . indexPath , true , true ) ; <END_BUG> if ( index == null ) return true ; ReadWriteMonitor monitor = this . manager . getMonitorFor ( index ) ; if ( monitor == null ) return true ; try { monitor . enterRead ( ) ; saveIfNecessary ( index , monitor ) ; IQueryResult [ ] results = index . queryInDocumentNames ( "" ) ; int max = ( results == null ) ? 0 : results . length ; final SimpleLookupTable indexedFileNames = new SimpleLookupTable ( ( max == 0 ? 33 : max + 11 ) ) ; final String OK = "OK" ; final String DELETED = "DELETED" ; if ( max == 0 ) { this . folder . accept ( new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) { if ( isCancelled ) return false ; if ( ( proxy . getType ( ) ) == ( IResource . FILE ) ) { if ( Util . isClassFileName ( proxy . getName ( ) ) ) { IResource resource = proxy . requestResource ( ) ; if ( ( resource . getLocation ( ) ) != null ) { String name = new IFileDocument ( ( ( IFile ) ( resource ) ) ) . getName ( ) ; indexedFileNames . put ( name , resource ) ; } } return false ; } return true ; } } , IResource . NONE ) ; } else { for ( int i = 0 ; i < max ; i ++ ) indexedFileNames . put ( results [ i ] . getPath ( ) , DELETED ) ; final long indexLastModified = index . getIndexFile ( ) . lastModified ( ) ; this . folder . accept ( new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) { if ( isCancelled ) return false ; if ( ( proxy . getType ( ) ) == ( IResource . FILE ) ) { if ( Util . isClassFileName ( proxy . getName ( ) ) ) { IResource resource = proxy . requestResource ( ) ; IPath path = resource . getLocation ( ) ; if ( path != null ) { String name = new IFileDocument ( ( ( IFile ) ( resource ) ) ) . getName ( ) ; indexedFileNames . put ( name , ( ( ( indexedFileNames . get ( name ) ) == null ) || ( indexLastModified < ( path . toFile ( ) . lastModified ( ) ) ) ? ( ( Object ) ( resource ) ) : ( ( Object ) ( OK ) ) ) ) ; } } return false ; } return true ; } } , IResource . NONE ) ; } Object [ ] names = indexedFileNames . keyTable ; Object [ ] values = indexedFileNames . valueTable ; boolean shouldSave = false ; for ( int i = 0 , length = names . length ; i < length ; i ++ ) { String name = ( ( String ) ( names [ i ] ) ) ; if ( name != null ) { if ( this . isCancelled ) return false ; Object value = values [ i ] ; if ( value != OK ) { shouldSave = true ; if ( value == DELETED ) this . manager . remove ( name , this . indexPath ) ; else this . manager . addBinary ( ( ( IFile ) ( value ) ) , this . indexPath ) ; } } } if ( shouldSave ) this . manager . request ( new SaveIndex ( this . indexPath , this . manager ) ) ; } catch ( CoreException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>index<seq2seq4repair_space>" + ( this . folder ) ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } this . manager . removeIndex ( this . indexPath ) ; return false ; } catch ( IOException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>index<seq2seq4repair_space>" + ( this . folder ) ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } this . manager . removeIndex ( this . indexPath ) ; return false ; } finally { monitor . exitRead ( ) ; } return true ; } public int hashCode ( ) { } protected Integer updatedIndexState ( ) { } public String toString ( ) { } }

Fix:
IIndex index = this . manager . getIndexForUpdate ( this . indexPath , true , true ) ;