Buggy code:
class AddJarFileToIndex implements IJobConstants , IJob { IndexManager manager ; String projectName ; IFile resource ; private String toString ; IPath path ; public AddJarFileToIndex ( IFile resource , IndexManager manager , String projectName ) { } public boolean belongsTo ( String jobFamily ) { } public boolean execute ( ) { try { if ( ( this . resource ) != null ) { if ( ! ( this . resource . isLocal ( IResource . DEPTH_ZERO ) ) ) { return IJob . FAILED ; } } IPath indexedPath = this . path ; IIndex index = ( ( IIndex ) ( manager . getIndex ( indexedPath , false ) ) ) ; if ( index != null ) return IJob . COMPLETE ; index = manager . getIndex ( indexedPath ) ; if ( index == null ) return IJob . COMPLETE ; ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; if ( monitor == null ) return IJob . COMPLETE ; ZipFile zip = null ; try { Path zipFilePath = null ; monitor . enterWrite ( ) ; if ( ( resource ) != null ) { IPath location = this . resource . getLocation ( ) ; if ( location == null ) return IJob . FAILED ; zip = new ZipFile ( location . toFile ( ) ) ; zipFilePath = ( ( Path ) ( this . resource . getFullPath ( ) . makeRelative ( ) ) ) ; } else { zip = new ZipFile ( this . path . toFile ( ) ) ; zipFilePath = ( ( Path ) ( this . path ) ) ; zipFilePath = ( ( Path ) ( JavaProject . canonicalizedPath ( zipFilePath ) ) ) ; } if ( JobManager . VERBOSE ) System . out . println ( ( "INDEX<seq2seq4repair_space>:<seq2seq4repair_space>" + ( zip . getName ( ) ) ) ) ; long initialTime = System . currentTimeMillis ( ) ; final Hashtable indexedFileNames = new Hashtable ( 100 ) ; IQueryResult [ ] results = index . queryInDocumentNames ( "" ) ; int resultLength = ( results == null ) ? 0 : results . length ; if ( resultLength != 0 ) { for ( int i = 0 ; i < resultLength ; i ++ ) { String fileName = results [ i ] . getPath ( ) ; indexedFileNames . put ( fileName , fileName ) ; } boolean needToReindex = false ; for ( Enumeration e = zip . entries ( ) ; e . hasMoreElements ( ) ; ) { ZipEntry ze = ( ( ZipEntry ) ( e . nextElement ( ) ) ) ; if ( Util . isClassFileName ( ze . getName ( ) ) ) { JarFileEntryDocument entryDocument = new JarFileEntryDocument ( ze , null , zipFilePath ) ; if ( ( indexedFileNames . remove ( entryDocument . getName ( ) ) ) == null ) { needToReindex = true ; break ; } } } if ( ( ! needToReindex ) && ( ( indexedFileNames . size ( ) ) == 0 ) ) { return IJob . COMPLETE ; } } if ( index != null ) { index = manager . recreateIndex ( indexedPath ) ; } for ( Enumeration e = zip . entries ( ) ; e . hasMoreElements ( ) ; ) { ZipEntry ze = ( ( ZipEntry ) ( e . nextElement ( ) ) ) ; if ( Util . isClassFileName ( ze . getName ( ) ) ) { InputStream zipInputStream = zip . getInputStream ( ze ) ; byte [ ] classFileBytes = new byte [ ( ( int ) ( ze . getSize ( ) ) ) ] ; int length = classFileBytes . length ; int len = 0 ; int readSize = 0 ; while ( ( readSize != ( - 1 ) ) && ( len != length ) ) { readSize = zipInputStream . read ( classFileBytes , len , ( length - len ) ) ; len += readSize ; } zipInputStream . close ( ) ; <START_BUG> index . add ( new JarFileEntryDocument ( ze , classFileBytes , zipFilePath ) , new BinaryIndexer ( ) ) ; <END_BUG> } } if ( JobManager . VERBOSE ) System . out . println ( ( ( ( ( "INDEX<seq2seq4repair_space>:<seq2seq4repair_space>" + ( zip . getName ( ) ) ) + "<seq2seq4repair_space>COMPLETE<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( ( System . currentTimeMillis ( ) ) - initialTime ) ) + "<seq2seq4repair_space>ms" ) ) ; } finally { if ( zip != null ) zip . close ( ) ; monitor . exitWrite ( ) ; } } catch ( IOException e ) { return IJob . FAILED ; } return IJob . COMPLETE ; } public String toString ( ) { } public AddJarFileToIndex ( IPath path , IndexManager manager , String projectName ) { } }

Fix:
index . add ( new JarFileEntryDocument ( ze , classFileBytes , zipFilePath ) , new BinaryIndexer ( true ) ) ;