Buggy code:
public class MatchLocator implements ITypeRequestor { public SearchPattern pattern ; public int detailLevel ; public IJavaSearchResultCollector collector ; public IJavaSearchScope scope ; public MatchLocatorParser parser ; private INameEnvironment nameEnvironment ; public NameLookup nameLookup ; public LookupEnvironment lookupEnvironment ; public HashtableOfObject parsedUnits ; public MatchingOpenableSet matchingOpenables ; private MatchingOpenable currentMatchingOpenable ; public HandleFactory handleFactory ; public IWorkingCopy [ ] workingCopies ; private static char [ ] EMPTY_FILE_NAME = new char [ 0 ] ; public MatchLocator ( SearchPattern pattern , int detailLevel , IJavaSearchResultCollector collector , IJavaSearchScope scope ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } public CompilationUnitDeclaration buildBindings ( org . eclipse . jdt . core . ICompilationUnit compilationUnit ) throws JavaModelException { } 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 ( ) { } private void initializeMatchingOpenables ( IWorkingCopy [ ] workingCopies ) { } public void locateMatches ( String [ ] filePaths , IWorkspace workspace , IWorkingCopy [ ] workingCopies , IProgressMonitor progressMonitor ) throws JavaModelException { } public void locatePackageDeclarations ( IWorkspace workspace ) throws JavaModelException { } private void locatePackageDeclarations ( SearchPattern searchPattern , IWorkspace workspace ) throws JavaModelException { if ( searchPattern instanceof OrPattern ) { OrPattern orPattern = ( ( OrPattern ) ( searchPattern ) ) ; this . locatePackageDeclarations ( orPattern . leftPattern , workspace ) ; this . locatePackageDeclarations ( orPattern . rightPattern , workspace ) ; } else if ( searchPattern instanceof PackageDeclarationPattern ) { PackageDeclarationPattern pkgPattern = ( ( PackageDeclarationPattern ) ( searchPattern ) ) ; <START_BUG> IJavaProject [ ] projects = JavaModelManager . getJavaModel ( workspace ) . getJavaProjects ( ) ; <END_BUG> for ( int i = 0 , length = projects . length ; i < length ; i ++ ) { IJavaProject javaProject = projects [ i ] ; IPackageFragmentRoot [ ] roots = javaProject . getPackageFragmentRoots ( ) ; for ( int j = 0 , rootsLength = roots . length ; j < rootsLength ; j ++ ) { IJavaElement [ ] pkgs = roots [ j ] . getChildren ( ) ; for ( int k = 0 , pksLength = pkgs . length ; k < pksLength ; k ++ ) { IPackageFragment pkg = ( ( IPackageFragment ) ( pkgs [ k ] ) ) ; if ( ( ( pkg . getChildren ( ) . length ) > 0 ) && ( pkgPattern . matchesName ( pkgPattern . pkgName , pkg . getElementName ( ) . toCharArray ( ) ) ) ) { IResource resource = pkg . getUnderlyingResource ( ) ; if ( resource == null ) { resource = javaProject . getProject ( ) ; } this . currentMatchingOpenable = new MatchingOpenable ( this , resource , null ) ; try { this . report ( ( - 1 ) , ( - 2 ) , pkg , IJavaSearchResultCollector . EXACT_MATCH ) ; } catch ( CoreException e ) { if ( e instanceof JavaModelException ) { throw ( ( JavaModelException ) ( e ) ) ; } else { throw new JavaModelException ( e ) ; } } } } } } } } public IType lookupType ( TypeBinding typeBinding ) { } public void report ( int sourceStart , int sourceEnd , IJavaElement element , int accuracy ) throws CoreException { } public void report ( IResource resource , int sourceStart , int sourceEnd , IJavaElement element , int accuracy ) throws CoreException { } public void reportBinaryMatch ( IMember binaryMember , IBinaryType info , int accuracy ) throws CoreException , JavaModelException { } public void reportBinaryMatch ( IResource resource , IMember binaryMember , IBinaryType info , int accuracy ) throws CoreException , JavaModelException { } public void reportFieldDeclaration ( FieldDeclaration fieldDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } public void reportImport ( ImportReference reference , int accuracy ) throws CoreException { } public void reportMethodDeclaration ( AbstractMethodDeclaration methodDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } public void reportPackageDeclaration ( ImportReference node ) { } public void reportPackageReference ( ImportReference node ) { } public void reportAccurateReference ( int sourceStart , int sourceEnd , char [ ] [ ] qualifiedName , IJavaElement element , int accuracy ) throws CoreException { } public void reportAccurateReference ( int sourceStart , int sourceEnd , char [ ] [ ] tokens , IJavaElement element , int [ ] accuracies ) throws CoreException { } public void reportReference ( AstNode reference , AbstractMethodDeclaration methodDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } public void reportReference ( AstNode reference , TypeDeclaration typeDeclaration , FieldDeclaration fieldDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } public void reportSuperTypeReference ( TypeReference typeRef , IJavaElement type , int accuracy ) throws CoreException { } public void reportTypeDeclaration ( TypeDeclaration typeDeclaration , IJavaElement parent , int accuracy ) throws CoreException { } private MatchingOpenable newMatchingOpenable ( IResource resource , Openable openable ) { } private void addMatchingOpenable ( IResource resource , Openable openable ) throws JavaModelException { } public void createParser ( JavaProject project ) throws JavaModelException { } private INameEnvironment getNameEnvironment ( JavaProject project ) throws JavaModelException { } public CompilationUnitDeclaration dietParse ( final char [ ] source ) { } public char [ ] findSource ( ClassFile classFile ) { }

Fix:
IJavaProject [ ] projects = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) . getJavaProjects ( ) ;