Buggy code:
public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } protected Parser basicParser ( ) { } protected void buildBindings ( PossibleMatch possibleMatch ) { } protected BinaryTypeBinding cacheBinaryType ( IType type ) throws JavaModelException { } protected char [ ] [ ] [ ] computeSuperTypeNames ( IType focusType ) { } protected IJavaElement createHandle ( AbstractMethodDeclaration method , IJavaElement parent ) { } protected IJavaElement createHandle ( FieldDeclaration fieldDeclaration , TypeDeclaration typeDeclaration , IJavaElement parent ) { } protected boolean createHierarchyResolver ( IType focusType , PossibleMatch [ ] possibleMatches ) { } protected IJavaElement createImportHandle ( ImportReference importRef ) { } protected IType createTypeHandle ( String simpleTypeName ) { } protected boolean encloses ( IJavaElement element ) { } protected IBinaryType getBinaryInfo ( ClassFile classFile , IResource resource ) throws CoreException { } protected IType getFocusType ( ) { } protected void getMethodBodies ( CompilationUnitDeclaration unit ) { } protected boolean hasAlreadyDefinedType ( CompilationUnitDeclaration parsedUnit ) { } public void initialize ( JavaProject project , int possibleMatchSize ) throws JavaModelException { } protected void locateMatches ( JavaProject javaProject , PossibleMatch [ ] possibleMatches , int start , int length ) throws JavaModelException { } protected void locateMatches ( JavaProject javaProject , PossibleMatchSet matchSet ) throws JavaModelException { } public void locateMatches ( SearchDocument [ ] searchDocuments ) throws JavaModelException { } public void locatePackageDeclarations ( SearchParticipant participant ) throws JavaModelException { } protected void locatePackageDeclarations ( SearchPattern searchPattern , SearchParticipant participant ) throws JavaModelException { } protected IType lookupType ( ReferenceBinding typeBinding ) { } public JavaSearchMatch newDeclarationMatch ( IJavaElement element , int accuracy , int sourceStart , int sourceEnd ) { } public JavaSearchMatch newDeclarationMatch ( IJavaElement element , int accuracy , int sourceStart , int sourceEnd , SearchParticipant participant , IResource resource ) { } public JavaSearchMatch newFieldReferenceMatch ( IJavaElement enclosingElement , int accuracy , int sourceStart , int sourceEnd , Reference reference ) { } public JavaSearchMatch newReferenceMatch ( int referenceType , IJavaElement enclosingElement , int accuracy , int sourceStart , int sourceEnd ) { } protected void process ( PossibleMatch possibleMatch , boolean bindingsWereCreated ) throws CoreException { } protected void purgeMethodStatements ( TypeDeclaration type , boolean checkEachMethod ) { } protected void reduceParseTree ( CompilationUnitDeclaration unit ) { } public SearchParticipant getParticipant ( ) { } protected void report ( SearchMatch match ) throws CoreException { } protected void reportAccurateTypeReference ( ASTNode typeRef , char [ ] name , IJavaElement element , int accuracy ) throws CoreException { } protected void reportAccurateFieldReference ( QualifiedNameReference qNameRef , IJavaElement element , int [ ] accuracies ) throws CoreException { } protected void reportBinaryMemberDeclaration ( IResource resource , IMember binaryMember , IBinaryType info , int accuracy ) throws CoreException { } protected void reportMatching ( AbstractMethodDeclaration method , IJavaElement parent , int accuracy , boolean typeInHierarchy , MatchingNodeSet nodeSet ) throws CoreException { } protected void reportMatching ( CompilationUnitDeclaration unit , boolean mustResolve ) throws CoreException { MatchingNodeSet nodeSet = this . currentPossibleMatch . nodeSet ; if ( mustResolve ) { Object [ ] nodes = nodeSet . possibleMatchingNodesSet . values ; for ( int i = 0 , l = nodes . length ; i < l ; i ++ ) { ASTNode node = ( ( ASTNode ) ( nodes [ i ] ) ) ; if ( node == null ) continue ; if ( node instanceof ImportReference ) { if ( ( this . hierarchyResolver ) != null ) continue ; ImportReference importRef = ( ( ImportReference ) ( node ) ) ; Binding binding = ( importRef . onDemand ) ? unit . scope . getTypeOrPackage ( CharOperation . subarray ( importRef . tokens , 0 , importRef . tokens . length ) ) : unit . scope . getTypeOrPackage ( importRef . tokens ) ; this . patternLocator . matchLevelAndReportImportRef ( importRef , binding , this ) ; } else { nodeSet . addMatch ( node , this . patternLocator . resolveLevel ( node ) ) ; } } <START_BUG> nodeSet . possibleMatchingNodesSet = new org . eclipse . jdt . internal . core . util . SimpleSet ( ) ; <END_BUG> } if ( ( nodeSet . matchingNodes . elementSize ) == 0 ) return ; boolean matchedUnitContainer = ( ( this . matchContainer ) & ( PatternLocator . COMPILATION_UNIT_CONTAINER ) ) != 0 ; if ( matchedUnitContainer ) { ImportReference [ ] imports = unit . imports ; if ( imports != null ) { for ( int i = 0 , l = imports . length ; i < l ; i ++ ) { ImportReference importRef = imports [ i ] ; Integer level = ( ( Integer ) ( nodeSet . matchingNodes . removeKey ( importRef ) ) ) ; if ( level != null ) this . patternLocator . matchReportImportRef ( importRef , null , createImportHandle ( importRef ) , level . intValue ( ) , this ) ; } } } TypeDeclaration [ ] types = unit . types ; if ( types != null ) { for ( int i = 0 , l = types . length ; i < l ; i ++ ) { if ( ( nodeSet . matchingNodes . elementSize ) == 0 ) return ; TypeDeclaration type = types [ i ] ; Integer level = ( ( Integer ) ( nodeSet . matchingNodes . removeKey ( type ) ) ) ; int accuracy = ( ( level != null ) && matchedUnitContainer ) ? level . intValue ( ) : - 1 ; reportMatching ( type , null , accuracy , nodeSet , 1 ) ; } } } protected void reportMatching ( FieldDeclaration field , TypeDeclaration type , IJavaElement parent , int accuracy , boolean typeInHierarchy , MatchingNodeSet nodeSet ) throws CoreException { } protected void reportMatching ( TypeDeclaration type , IJavaElement parent , int accuracy , MatchingNodeSet nodeSet , int occurrenceCount ) throws CoreException { }

Fix:
nodeSet . possibleMatchingNodesSet = new org . eclipse . jdt . internal . core . util . SimpleSet ( 3 ) ;