Buggy code:
public class IndexBinaryFolder extends IndexRequest { IFolder folder ; IndexManager manager ; IProject project ; public IndexBinaryFolder ( IFolder folder , IndexManager manager , IProject project ) { } public boolean belongsTo ( String jobFamily ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) return IJob . COMPLETE ; if ( ! ( this . folder . isAccessible ( ) ) ) return IJob . COMPLETE ; <START_BUG> IIndex index = manager . getIndex ( this . folder . getFullPath ( ) ) ; <END_BUG> if ( index == null ) return IJob . COMPLETE ; ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; if ( monitor == null ) return IJob . COMPLETE ; try { monitor . enterRead ( ) ; if ( index . hasChanged ( ) ) { try { monitor . exitRead ( ) ; monitor . enterWrite ( ) ; if ( IndexManager . VERBOSE ) JobManager . verbose ( ( "-><seq2seq4repair_space>merging<seq2seq4repair_space>index<seq2seq4repair_space>" + ( index . getIndexFile ( ) ) ) ) ; index . save ( ) ; } catch ( IOException e ) { return IJob . FAILED ; } finally { monitor . exitWriteEnterRead ( ) ; } } final String OK = "OK" ; final String DELETED = "DELETED" ; final long indexLastModified = index . getIndexFile ( ) . lastModified ( ) ; final Hashtable indexedFileNames = new Hashtable ( 100 ) ; IQueryResult [ ] results = index . queryInDocumentNames ( "" ) ; for ( int i = 0 , max = ( results == null ) ? 0 : results . length ; i < max ; i ++ ) { String fileName = results [ i ] . getPath ( ) ; indexedFileNames . put ( fileName , DELETED ) ; } this . folder . accept ( new IResourceVisitor ( ) { public boolean visit ( IResource resource ) { if ( isCancelled ) return false ; if ( ( resource . getType ( ) ) == ( IResource . FILE ) ) { String extension = resource . getFileExtension ( ) ; if ( ( extension != null ) && ( extension . equalsIgnoreCase ( "class" ) ) ) { IPath path = resource . getLocation ( ) ; if ( path != null ) { File resourceFile = path . toFile ( ) ; String name = new IFileDocument ( ( ( IFile ) ( resource ) ) ) . getName ( ) ; if ( ( indexedFileNames . get ( name ) ) == null ) { indexedFileNames . put ( name , resource ) ; } else { indexedFileNames . put ( name , ( ( resourceFile . lastModified ( ) ) > indexLastModified ? ( ( Object ) ( resource ) ) : ( ( Object ) ( OK ) ) ) ) ; } } } return false ; } return true ; } } ) ; Enumeration names = indexedFileNames . keys ( ) ; while ( names . hasMoreElements ( ) ) { if ( this . isCancelled ) return IJob . FAILED ; String name = ( ( String ) ( names . nextElement ( ) ) ) ; Object value = indexedFileNames . get ( name ) ; if ( value instanceof IFile ) { manager . addBinary ( ( ( IFile ) ( value ) ) , this . folder . getFullPath ( ) ) ; } else if ( value == DELETED ) { manager . remove ( name , this . project . getFullPath ( ) ) ; } } } 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 ( ) ; } manager . removeIndex ( this . folder . getFullPath ( ) ) ; return IJob . FAILED ; } 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 ( ) ; } manager . removeIndex ( this . folder . getFullPath ( ) ) ; return IJob . FAILED ; } finally { monitor . exitRead ( ) ; } return IJob . COMPLETE ; } public String toString ( ) { } }

Fix:
IIndex index = manager . getIndex ( this . folder . getFullPath ( ) , true , true ) ;