Buggy code:
public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } public IField createFieldHandle ( FieldDeclaration field , IType type ) { } public IJavaElement createImportHandle ( ImportReference importRef ) { } public IInitializer createInitializerHandle ( TypeDeclaration typeDecl , FieldDeclaration initializer , IType type ) { } public IMethod createMethodHandle ( AbstractMethodDeclaration method , IType type ) { } private ClassFileReader classFileReader ( IType type ) { } public IType createTypeHandle ( char [ ] simpleTypeName ) { } public IType createTypeHandle ( IType parent , char [ ] simpleTypeName ) { } protected IResource getCurrentResource ( ) { } protected Scanner getScanner ( ) { } public void initialize ( JavaProject project ) throws JavaModelException { } public void initializeNameEnvironment ( JavaProject project ) throws JavaModelException { } public void locateMatches ( String [ ] filePaths , IWorkspace workspace , IWorkingCopy [ ] workingCopies ) throws JavaModelException { if ( VERBOSE ) { System . out . println ( "Locating<seq2seq4repair_space>matches<seq2seq4repair_space>in<seq2seq4repair_space>files<seq2seq4repair_space>[" ) ; for ( int i = 0 , length = filePaths . length ; i < length ; i ++ ) { String path = filePaths [ i ] ; System . out . println ( ( "\t" + path ) ) ; } System . out . println ( "]" ) ; if ( workingCopies != null ) { System . out . println ( "<seq2seq4repair_space>and<seq2seq4repair_space>working<seq2seq4repair_space>copies<seq2seq4repair_space>[" ) ; for ( int i = 0 , length = workingCopies . length ; i < length ; i ++ ) { IWorkingCopy wc = workingCopies [ i ] ; System . out . println ( ( "\t" + ( ( ( JavaElement ) ( wc ) ) . toStringWithAncestors ( ) ) ) ) ; } System . out . println ( "]" ) ; } } JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; try { manager . cacheZipFiles ( ) ; if ( ( this . handleFactory ) == null ) { this . handleFactory = new HandleFactory ( workspace ) ; } this . workingCopies = workingCopies ; HashMap wcPaths = new HashMap ( ) ; int wcLength ; if ( ( workingCopies != null ) && ( ( wcLength = workingCopies . length ) > 0 ) ) { String [ ] newPaths = new String [ wcLength ] ; for ( int i = 0 ; i < wcLength ; i ++ ) { IWorkingCopy workingCopy = workingCopies [ i ] ; String path = workingCopy . getOriginalElement ( ) . getPath ( ) . toString ( ) ; wcPaths . put ( path , workingCopy ) ; newPaths [ i ] = path ; } int filePathsLength = filePaths . length ; System . arraycopy ( filePaths , 0 , ( filePaths = new String [ filePathsLength + wcLength ] ) , 0 , filePathsLength ) ; System . arraycopy ( newPaths , 0 , filePaths , filePathsLength , wcLength ) ; } int length = filePaths . length ; if ( ( progressMonitor ) != null ) { if ( this . pattern . needsResolve ) { progressMonitor . beginTask ( "" , ( length * 10 ) ) ; } else { progressMonitor . beginTask ( "" , ( length * 4 ) ) ; } } Util . sort ( filePaths ) ; this . matchingOpenables = new MatchingOpenableSet ( ) ; this . pattern . initializePolymorphicSearch ( this , progressMonitor ) ; JavaProject previousJavaProject = null ; for ( int i = 0 ; i < length ; i ++ ) { if ( ( ( progressMonitor ) != null ) && ( progressMonitor . isCanceled ( ) ) ) { throw new OperationCanceledException ( ) ; } String pathString = filePaths [ i ] ; if ( ( i > 0 ) && ( pathString . equals ( filePaths [ ( i - 1 ) ] ) ) ) continue ; Openable openable ; IWorkingCopy workingCopy = ( ( IWorkingCopy ) ( wcPaths . get ( pathString ) ) ) ; if ( workingCopy != null ) { openable = ( ( Openable ) ( workingCopy ) ) ; } else { <START_BUG> openable = this . handleFactory . createOpenable ( pathString ) ; <END_BUG> if ( openable == null ) continue ; } IResource resource = null ; JavaProject javaProject = null ; try { javaProject = ( ( JavaProject ) ( openable . getJavaProject ( ) ) ) ; if ( workingCopy != null ) { resource = workingCopy . getOriginalElement ( ) . getResource ( ) ; } else { resource = openable . getResource ( ) ; } if ( resource == null ) { resource = javaProject . getProject ( ) ; } if ( ! ( javaProject . equals ( previousJavaProject ) ) ) { if ( previousJavaProject != null ) { try { this . locateMatches ( previousJavaProject ) ; } catch ( JavaModelException e ) { if ( ( e . getException ( ) ) instanceof CoreException ) { throw e ; } else { } } this . matchingOpenables = new MatchingOpenableSet ( ) ; } if ( length == 1 ) { if ( ( this . nameEnvironment ) != null ) { this . nameEnvironment . cleanup ( ) ; } this . nameEnvironment = javaProject . getSearchableNameEnvironment ( ) ; } else { this . initializeNameEnvironment ( javaProject ) ; } this . initialize ( javaProject ) ; previousJavaProject = javaProject ; } } catch ( JavaModelException e ) { continue ; } this . addMatchingOpenable ( resource , openable , null , null ) ; if ( ( progressMonitor ) != null ) { progressMonitor . worked ( 1 ) ; } }

Fix:
openable = this . handleFactory . createOpenable ( pathString , this . scope ) ;