Buggy code:
public class SuperTypeNamesCollector { public class TypeDeclarationVisitor extends ASTVisitor { public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { } public boolean visit ( TypeDeclaration typeDeclaration , CompilationUnitScope scope ) { } public boolean visit ( TypeDeclaration memberTypeDeclaration , ClassScope scope ) { } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { } public boolean visit ( Initializer initializer , MethodScope scope ) { } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { } } SearchPattern pattern ; char [ ] typeSimpleName ; char [ ] typeQualification ; MatchLocator locator ; IType type ; IProgressMonitor progressMonitor ; char [ ] [ ] [ ] result ; int resultIndex ; public SuperTypeNamesCollector ( SearchPattern pattern , char [ ] typeSimpleName , char [ ] typeQualification , MatchLocator locator , IType type , IProgressMonitor progressMonitor ) { } protected void addToResult ( char [ ] [ ] compoundName ) { } protected CompilationUnitDeclaration buildBindings ( ICompilationUnit compilationUnit , boolean isTopLevelOrMember ) throws JavaModelException { } public char [ ] [ ] [ ] collect ( ) throws JavaModelException { } protected void collectSuperTypeNames ( ReferenceBinding binding ) { } protected String [ ] getPathsOfDeclaringType ( ) { if ( ( ( this . typeQualification ) == null ) && ( ( this . typeSimpleName ) == null ) ) return null ; final PathCollector pathCollector = new PathCollector ( ) ; IJavaSearchScope scope = SearchEngine . createWorkspaceScope ( ) ; IndexManager indexManager = JavaModelManager . getJavaModelManager ( ) . getIndexManager ( ) ; SearchPattern searchPattern = new TypeDeclarationPattern ( ( ( this . typeSimpleName ) != null ? null : this . typeQualification ) , null , this . typeSimpleName , IIndexConstants . TYPE_SUFFIX , this . pattern . getMatchRule ( ) ) ; IndexQueryRequestor searchRequestor = new IndexQueryRequestor ( ) { public boolean acceptIndexMatch ( String documentPath , SearchPattern indexRecord , SearchParticipant participant ) { TypeDeclarationPattern record = ( ( TypeDeclarationPattern ) ( indexRecord ) ) ; if ( ( record . enclosingTypeNames ) != ( IIndexConstants . ONE_ZERO_CHAR ) ) { pathCollector . acceptIndexMatch ( documentPath , indexRecord , participant ) ; } return true ; } } ; <START_BUG> indexManager . performConcurrentJob ( new PatternSearchJob ( searchPattern , new JavaSearchParticipant ( this . locator . workingCopies ) , scope , searchRequestor ) , IJavaSearchConstants . WAIT_UNTIL_READY_TO_SEARCH , ( ( progressMonitor ) == null ? null : new SubProgressMonitor ( progressMonitor , 100 ) ) ) ; <END_BUG> return pathCollector . getPaths ( ) ; } protected boolean matches ( char [ ] [ ] compoundName ) { } protected boolean matches ( ReferenceBinding binding ) { } }

Fix:
indexManager . performConcurrentJob ( new PatternSearchJob ( searchPattern , new JavaSearchParticipant ( ) , scope , searchRequestor ) , IJavaSearchConstants . WAIT_UNTIL_READY_TO_SEARCH , ( ( progressMonitor ) == null ? null : new SubProgressMonitor ( progressMonitor , 100 ) ) ) ;