Buggy code:
public class SuperTypeNamesCollector implements ITypeRequestor { MethodReferencePattern pattern ; MatchLocator locator ; IType type ; IProgressMonitor progressMonitor ; char [ ] [ ] [ ] result ; int resultIndex ; public class TypeDeclarationVisitor extends AbstractSyntaxTreeVisitorAdapter { public boolean visit ( LocalTypeDeclaration typeDeclaration , BlockScope scope ) { } public boolean visit ( AnonymousLocalTypeDeclaration typeDeclaration , BlockScope scope ) { } public boolean visit ( TypeDeclaration typeDeclaration , CompilationUnitScope scope ) { } public boolean visit ( MemberTypeDeclaration 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 ) { } } public SuperTypeNamesCollector ( MethodReferencePattern pattern , MatchLocator locator , IType type , IProgressMonitor progressMonitor ) { } private CompilationUnitDeclaration buildBindings ( ICompilationUnit compilationUnit ) throws JavaModelException { } protected char [ ] [ ] [ ] collect ( ) throws JavaModelException { if ( ( this . type ) != null ) { this . result = new char [ 1 ] [ ] [ ] ; this . resultIndex = 0 ; JavaProject javaProject = ( ( JavaProject ) ( this . type . getJavaProject ( ) ) ) ; this . locator . initializeNameEnvironment ( javaProject ) ; this . locator . initialize ( javaProject ) ; synchronized ( this . locator . nameLookup ) { this . locator . nameLookup . setUnitsToLookInside ( this . locator . workingCopies ) ; try { if ( this . type . isBinary ( ) ) { BinaryTypeBinding binding = this . locator . cacheBinaryType ( this . type ) ; if ( binding != null ) { this . collectSuperTypeNames ( binding ) ; } } else { ICompilationUnit unit = this . type . getCompilationUnit ( ) ; CompilationUnitDeclaration parsedUnit = this . buildBindings ( unit ) ; if ( parsedUnit != null ) { parsedUnit . traverse ( new SuperTypeNamesCollector . TypeDeclarationVisitor ( ) , parsedUnit . scope ) ; } } } catch ( AbortCompilation e ) { return null ; } finally { this . locator . nameLookup . setUnitsToLookInside ( null ) ; } } return this . result ; } else { String [ ] paths = this . getPathsOfDeclaringType ( ) ; if ( paths != null ) { Util . sort ( paths ) ; JavaProject previousProject = null ; this . result = new char [ 1 ] [ ] [ ] ; this . resultIndex = 0 ; try { for ( int i = 0 , length = paths . length ; i < length ; i ++ ) { try { <START_BUG> Openable openable = this . locator . handleFactory . createOpenable ( paths [ i ] ) ; <END_BUG> if ( openable == null ) continue ; IJavaProject project = openable . getJavaProject ( ) ; if ( ! ( project . equals ( previousProject ) ) ) { if ( previousProject != null ) { this . locator . nameLookup . setUnitsToLookInside ( null ) ; } previousProject = ( ( JavaProject ) ( project ) ) ; this . locator . initializeNameEnvironment ( previousProject ) ; this . locator . initialize ( previousProject ) ; this . locator . nameLookup . setUnitsToLookInside ( this . locator . workingCopies ) ; } if ( openable instanceof ICompilationUnit ) { ICompilationUnit unit = ( ( ICompilationUnit ) ( openable ) ) ; CompilationUnitDeclaration parsedUnit = this . buildBindings ( unit ) ; if ( parsedUnit != null ) { parsedUnit . traverse ( new SuperTypeNamesCollector . TypeDeclarationVisitor ( ) , parsedUnit . scope ) ; } } else if ( openable instanceof IClassFile ) { IClassFile classFile = ( ( IClassFile ) ( openable ) ) ; BinaryTypeBinding binding = this . locator . cacheBinaryType ( classFile . getType ( ) ) ; if ( this . matches ( binding ) ) { this . collectSuperTypeNames ( binding ) ; } } } catch ( AbortCompilation e ) { } catch ( JavaModelException e ) { } } } finally { if ( previousProject != null ) { this . locator . nameLookup . setUnitsToLookInside ( null ) ; } } System . arraycopy ( this . result , 0 , ( this . result = new char [ this . resultIndex ] [ ] [ ] ) , 0 , this . resultIndex ) ; return this . result ; } else { return null ; } } } protected boolean matches ( ReferenceBinding type ) { } protected boolean matches ( char [ ] [ ] compoundName ) { } private void addToResult ( char [ ] [ ] compoundName ) { } protected void collectSuperTypeNames ( ReferenceBinding type ) { } private String [ ] getPathsOfDeclaringType ( ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( org . eclipse . jdt . internal . compiler . env . ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } }

Fix:
Openable openable = this . locator . handleFactory . createOpenable ( paths [ i ] , this . locator . scope ) ;