Buggy code:
class AddJarFileToIndex extends IndexRequest { IFile resource ; public AddJarFileToIndex ( IFile resource , IndexManager manager ) { } public AddJarFileToIndex ( IPath jarPath , IndexManager manager ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( this . isCancelled ) || ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) ) return true ; try { Index index = manager . getIndexForUpdate ( this . containerPath , false , false ) ; if ( index != null ) { if ( JobManager . VERBOSE ) JobManager . verbose ( ( "-><seq2seq4repair_space>no<seq2seq4repair_space>indexing<seq2seq4repair_space>required<seq2seq4repair_space>(index<seq2seq4repair_space>already<seq2seq4repair_space>exists)<seq2seq4repair_space>for<seq2seq4repair_space>" + ( this . containerPath ) ) ) ; return true ; } index = manager . getIndexForUpdate ( this . containerPath , true , true ) ; if ( index == null ) { if ( JobManager . VERBOSE ) JobManager . verbose ( ( "-><seq2seq4repair_space>index<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>created<seq2seq4repair_space>for<seq2seq4repair_space>" + ( this . containerPath ) ) ) ; return true ; } <START_BUG> ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; <END_BUG> if ( monitor == null ) { if ( JobManager . VERBOSE ) JobManager . verbose ( ( ( "-><seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>" + ( this . containerPath ) ) + "<seq2seq4repair_space>just<seq2seq4repair_space>got<seq2seq4repair_space>deleted" ) ) ; return true ; } ZipFile zip = null ; try { Path zipFilePath = null ; monitor . enterWrite ( ) ; if ( ( resource ) != null ) { IPath location = this . resource . getLocation ( ) ; if ( location == null ) return false ; if ( JavaModelManager . ZIP_ACCESS_VERBOSE ) System . out . println ( ( ( ( "(" + ( Thread . currentThread ( ) ) ) + ")<seq2seq4repair_space>[AddJarFileToIndex.execute()]<seq2seq4repair_space>Creating<seq2seq4repair_space>ZipFile<seq2seq4repair_space>on<seq2seq4repair_space>" ) + location ) ) ; zip = new ZipFile ( location . toFile ( ) ) ; zipFilePath = ( ( Path ) ( this . resource . getFullPath ( ) . makeRelative ( ) ) ) ; } else { if ( JavaModelManager . ZIP_ACCESS_VERBOSE ) System . out . println ( ( ( ( "(" + ( Thread . currentThread ( ) ) ) + ")<seq2seq4repair_space>[AddJarFileToIndex.execute()]<seq2seq4repair_space>Creating<seq2seq4repair_space>ZipFile<seq2seq4repair_space>on<seq2seq4repair_space>" ) + ( this . containerPath ) ) ) ; zip = new ZipFile ( this . containerPath . toFile ( ) ) ; zipFilePath = ( ( Path ) ( this . containerPath ) ) ; } if ( this . isCancelled ) { if ( JobManager . VERBOSE ) JobManager . verbose ( ( ( "-><seq2seq4repair_space>indexing<seq2seq4repair_space>of<seq2seq4repair_space>" + ( zip . getName ( ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>cancelled" ) ) ; return false ; } if ( JobManager . VERBOSE ) JobManager . verbose ( ( "-><seq2seq4repair_space>indexing<seq2seq4repair_space>" + ( zip . getName ( ) ) ) ) ; long initialTime = System . currentTimeMillis ( ) ; String [ ] paths = index . queryDocumentNames ( "" ) ; int max = ( paths == null ) ? 0 : paths . length ; if ( max != 0 ) { String EXISTS = "OK" ; String DELETED = "DELETED" ; SimpleLookupTable indexedFileNames = new SimpleLookupTable ( ( max == 0 ? 33 : max + 11 ) ) ; for ( int i = 0 ; i < max ; i ++ ) indexedFileNames . put ( paths [ i ] , DELETED ) ; for ( Enumeration e = zip . entries ( ) ; e . hasMoreElements ( ) ; ) { ZipEntry ze = ( ( ZipEntry ) ( e . nextElement ( ) ) ) ; if ( Util . isClassFileName ( ze . getName ( ) ) ) { JavaSearchDocument entryDocument = new JavaSearchDocument ( ze , zipFilePath , null , null ) ; indexedFileNames . put ( entryDocument . getPath ( ) , EXISTS ) ; } } boolean needToReindex = ( indexedFileNames . elementSize ) != max ; if ( ! needToReindex ) { Object [ ] valueTable = indexedFileNames . valueTable ; for ( int i = 0 , l = valueTable . length ; i < l ; i ++ ) { if ( ( valueTable [ i ] ) == DELETED ) { needToReindex = true ; break ; } } if ( ! needToReindex ) { if ( JobManager . VERBOSE ) JobManager . verbose ( ( ( ( ( "-><seq2seq4repair_space>no<seq2seq4repair_space>indexing<seq2seq4repair_space>required<seq2seq4repair_space>(index<seq2seq4repair_space>is<seq2seq4repair_space>consistent<seq2seq4repair_space>with<seq2seq4repair_space>library)<seq2seq4repair_space>for<seq2seq4repair_space>" + ( zip . getName ( ) ) ) + "<seq2seq4repair_space>(" ) + ( ( System . currentTimeMillis ( ) ) - initialTime ) ) + "ms)" ) ) ; return true ; } } } SearchParticipant participant = SearchEngine . getDefaultSearchParticipant ( ) ; index = manager . recreateIndex ( this . containerPath ) ; for ( Enumeration e = zip . entries ( ) ; e . hasMoreElements ( ) ; ) { if ( this . isCancelled ) { if ( JobManager . VERBOSE ) JobManager . verbose ( ( ( "-><seq2seq4repair_space>indexing<seq2seq4repair_space>of<seq2seq4repair_space>" + ( zip . getName ( ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>cancelled" ) ) ; return false ; } ZipEntry ze = ( ( ZipEntry ) ( e . nextElement ( ) ) ) ; if ( Util . isClassFileName ( ze . getName ( ) ) ) { final byte [ ] classFileBytes = Util . getZipEntryByteContent ( ze , zip ) ; JavaSearchDocument entryDocument = new JavaSearchDocument ( ze , zipFilePath , classFileBytes , participant ) ; this . manager . indexDocument ( entryDocument , participant , index , this . containerPath ) ; } } this . manager . saveIndex ( index ) ; if ( JobManager . VERBOSE ) JobManager . verbose ( ( ( ( ( "-><seq2seq4repair_space>done<seq2seq4repair_space>indexing<seq2seq4repair_space>of<seq2seq4repair_space>" + ( zip . getName ( ) ) ) + "<seq2seq4repair_space>(" ) + ( ( System . currentTimeMillis ( ) ) - initialTime ) ) + "ms)" ) ) ; }

Fix:
ReadWriteMonitor monitor = index . monitor ;