Buggy code:
public class SearchEngine { static class SearchPatternAdapter implements ISearchPattern { SearchPattern pattern ; SearchPatternAdapter ( SearchPattern pattern ) { } } class ResultCollectorAdapter extends SearchRequestor { IJavaSearchResultCollector resultCollector ; ResultCollectorAdapter ( IJavaSearchResultCollector resultCollector ) { } public void acceptSearchMatch ( SearchMatch match ) throws CoreException { } public void beginReporting ( ) { } public void endReporting ( ) { } } class TypeNameRequestorAdapter implements IRestrictedAccessTypeRequestor { ITypeNameRequestor nameRequestor ; TypeNameRequestorAdapter ( ITypeNameRequestor requestor ) { } public void acceptType ( int modifiers , char [ ] packageName , char [ ] simpleTypeName , char [ ] [ ] enclosingTypeNames , String path , AccessRestriction access ) { } } private BasicSearchEngine basicEngine ; public SearchEngine ( ) { } public SearchEngine ( ICompilationUnit [ ] workingCopies ) { } public SearchEngine ( IWorkingCopy [ ] workingCopies ) { } public SearchEngine ( WorkingCopyOwner workingCopyOwner ) { } public static IJavaSearchScope createHierarchyScope ( IType type ) throws JavaModelException { } public static IJavaSearchScope createHierarchyScope ( IType type , WorkingCopyOwner owner ) throws JavaModelException { } public static IJavaSearchScope createJavaSearchScope ( IResource [ ] resources ) { } public static IJavaSearchScope createJavaSearchScope ( IJavaElement [ ] elements ) { } public static IJavaSearchScope createJavaSearchScope ( IJavaElement [ ] elements , boolean includeReferencedProjects ) { } public static IJavaSearchScope createJavaSearchScope ( IJavaElement [ ] elements , int includeMask ) { } public static ISearchPattern createOrSearchPattern ( ISearchPattern leftPattern , ISearchPattern rightPattern ) { } public static ISearchPattern createSearchPattern ( String stringPattern , int searchFor , int limitTo , boolean isCaseSensitive ) { } public static ISearchPattern createSearchPattern ( IJavaElement element , int limitTo ) { } public static IJavaSearchScope createWorkspaceScope ( ) { } public static SearchParticipant getDefaultSearchParticipant ( ) { } public void search ( IWorkspace workspace , String patternString , int searchFor , int limitTo , IJavaSearchScope scope , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void search ( IWorkspace workspace , IJavaElement element , int limitTo , IJavaSearchScope scope , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void search ( IWorkspace workspace , ISearchPattern searchPattern , IJavaSearchScope scope , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void search ( SearchPattern pattern , SearchParticipant [ ] participants , IJavaSearchScope scope , SearchRequestor requestor , IProgressMonitor monitor ) throws CoreException { } public void searchAllTypeNames ( final char [ ] packageExactName , final char [ ] typeName , final int matchRule , int searchFor , IJavaSearchScope scope , final TypeNameRequestor nameRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { } public void searchAllTypeNames ( final char [ ] packageName , final int packageMatchRule , final char [ ] typeName , final int typeMatchRule , int searchFor , IJavaSearchScope scope , final TypeNameRequestor nameRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { } public void searchAllTypeNames ( final char [ ] packageName , final int packageMatchRule , final char [ ] typeName , final int typeMatchRule , int searchFor , IJavaSearchScope scope , final TypeNameMatchRequestor nameMatchRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { <START_BUG> TypeNameMatchRequestorWrapper requestorWrapper = new TypeNameMatchRequestorWrapper ( nameMatchRequestor , scope , this . basicEngine . getWorkingCopies ( ) ) ; <END_BUG> this . basicEngine . searchAllTypeNames ( packageName , packageMatchRule , typeName , typeMatchRule , searchFor , scope , requestorWrapper , waitingPolicy , progressMonitor ) ; } public void searchAllTypeNames ( final char [ ] [ ] qualifications , final char [ ] [ ] typeNames , IJavaSearchScope scope , final TypeNameRequestor nameRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { } public void searchAllTypeNames ( final char [ ] packageName , final char [ ] typeName , final int matchRule , int searchFor , IJavaSearchScope scope , final ITypeNameRequestor nameRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { } public void searchAllTypeNames ( IWorkspace workspace , final char [ ] packageName , final char [ ] typeName , final int matchMode , final boolean isCaseSensitive , int searchFor , IJavaSearchScope scope , final ITypeNameRequestor nameRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws JavaModelException { } public void searchDeclarationsOfAccessedFields ( IJavaElement enclosingElement , SearchRequestor requestor , IProgressMonitor monitor ) throws JavaModelException { } public void searchDeclarationsOfAccessedFields ( IWorkspace workspace , IJavaElement enclosingElement , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void searchDeclarationsOfReferencedTypes ( IJavaElement enclosingElement , SearchRequestor requestor , IProgressMonitor monitor ) throws JavaModelException { } public void searchDeclarationsOfReferencedTypes ( IWorkspace workspace , IJavaElement enclosingElement , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } public void searchDeclarationsOfSentMessages ( IJavaElement enclosingElement , SearchRequestor requestor , IProgressMonitor monitor ) throws JavaModelException { } public void searchDeclarationsOfSentMessages ( IWorkspace workspace , IJavaElement enclosingElement , IJavaSearchResultCollector resultCollector ) throws JavaModelException { } }

Fix:
TypeNameMatchRequestorWrapper requestorWrapper = new TypeNameMatchRequestorWrapper ( nameMatchRequestor , scope ) ;