Buggy code:
private void reportHierarchy ( IType focus , TypeDeclaration focusLocalType , ReferenceBinding binaryTypeBinding ) { } private void reset ( ) { } public void resolve ( IGenericType suppliedType ) { } public void resolve ( Openable [ ] openables , HashSet localTypes , IProgressMonitor monitor ) { try { int openablesLength = openables . length ; CompilationUnitDeclaration [ ] parsedUnits = new CompilationUnitDeclaration [ openablesLength ] ; boolean [ ] hasLocalType = new boolean [ openablesLength ] ; org . eclipse . jdt . core . ICompilationUnit [ ] cus = new org . eclipse . jdt . core . ICompilationUnit [ openablesLength ] ; int unitsIndex = 0 ; CompilationUnitDeclaration focusUnit = null ; ReferenceBinding focusBinaryBinding = null ; IType focus = this . builder . getType ( ) ; Openable focusOpenable = null ; if ( focus != null ) { if ( focus . isBinary ( ) ) { focusOpenable = ( ( Openable ) ( focus . getClassFile ( ) ) ) ; } else { focusOpenable = ( ( Openable ) ( focus . getCompilationUnit ( ) ) ) ; } } Parser parser = new Parser ( this . lookupEnvironment . problemReporter , true ) ; for ( int i = 0 ; i < openablesLength ; i ++ ) { Openable openable = openables [ i ] ; if ( openable instanceof org . eclipse . jdt . core . ICompilationUnit ) { org . eclipse . jdt . core . ICompilationUnit cu = ( ( org . eclipse . jdt . core . ICompilationUnit ) ( openable ) ) ; boolean containsLocalType = false ; if ( localTypes == null ) { containsLocalType = true ; } else { IPath path = cu . getPath ( ) ; containsLocalType = localTypes . contains ( path . toString ( ) ) ; } CompilationUnitDeclaration parsedUnit = null ; if ( cu . isOpen ( ) ) { CompilationResult result = new CompilationResult ( ( ( ICompilationUnit ) ( cu ) ) . getFileName ( ) , i , openablesLength , this . options . maxProblemsPerUnit ) ; SourceTypeElementInfo [ ] typeInfos = null ; try { IType [ ] topLevelTypes = cu . getTypes ( ) ; int topLevelLength = topLevelTypes . length ; if ( topLevelLength == 0 ) continue ; typeInfos = new SourceTypeElementInfo [ topLevelLength ] ; for ( int j = 0 ; j < topLevelLength ; j ++ ) { IType topLevelType = topLevelTypes [ j ] ; typeInfos [ j ] = ( ( SourceTypeElementInfo ) ( ( ( JavaElement ) ( topLevelType ) ) . getElementInfo ( ) ) ) ; } } catch ( JavaModelException e ) { } int flags = ( ! containsLocalType ) ? SourceTypeConverter . MEMBER_TYPE : ( ( SourceTypeConverter . FIELD_AND_METHOD ) | ( SourceTypeConverter . MEMBER_TYPE ) ) | ( SourceTypeConverter . LOCAL_TYPE ) ; parsedUnit = SourceTypeConverter . buildCompilationUnit ( typeInfos , flags , this . lookupEnvironment . problemReporter , result ) ; if ( containsLocalType ) parsedUnit . bits |= ASTNode . HasAllMethodBodies ; } else { IFile file = ( ( IFile ) ( cu . getResource ( ) ) ) ; ICompilationUnit sourceUnit = this . builder . createCompilationUnitFromPath ( openable , file ) ; CompilationResult unitResult = new CompilationResult ( sourceUnit , i , openablesLength , this . options . maxProblemsPerUnit ) ; parsedUnit = parser . dietParse ( sourceUnit , unitResult ) ; } if ( parsedUnit != null ) { hasLocalType [ unitsIndex ] = containsLocalType ; cus [ unitsIndex ] = cu ; parsedUnits [ ( unitsIndex ++ ) ] = parsedUnit ; try { this . lookupEnvironment . buildTypeBindings ( parsedUnit , null ) ; if ( openable . equals ( focusOpenable ) ) { focusUnit = parsedUnit ; } } catch ( AbortCompilation e ) { } } } else { ClassFile classFile = ( ( ClassFile ) ( openable ) ) ; IBinaryType binaryType = ( ( IBinaryType ) ( JavaModelManager . getJavaModelManager ( ) . getInfo ( classFile . getType ( ) ) ) ) ; if ( binaryType == null ) { if ( classFile . getPackageFragmentRoot ( ) . isArchive ( ) ) { binaryType = this . builder . createInfoFromClassFileInJar ( classFile ) ; } else { <START_BUG> IResource file = classFile . getResource ( ) ; <END_BUG> binaryType = this . builder . createInfoFromClassFile ( classFile , file ) ; } } if ( binaryType != null ) { try { BinaryTypeBinding binaryTypeBinding = this . lookupEnvironment . cacheBinaryType ( binaryType , false , null ) ; remember ( binaryType , binaryTypeBinding ) ; if ( openable . equals ( focusOpenable ) ) { focusBinaryBinding = binaryTypeBinding ; } } catch ( AbortCompilation e ) { } } } } TypeDeclaration focusLocalType = null ; if ( ( ( ( focus != null ) && ( focusBinaryBinding == null ) ) && ( focusUnit != null ) ) && ( ( ( ( Member ) ( focus ) ) . getOuterMostLocalContext ( ) ) != null ) ) { focusLocalType = new ASTNodeFinder ( focusUnit ) . findType ( focus ) ; } for ( int i = 0 ; i <= ( this . typeIndex ) ; i ++ ) { IGenericType suppliedType = this . typeModels [ i ] ; if ( ( suppliedType != null ) && ( suppliedType . isBinaryType ( ) ) ) { CompilationUnitDeclaration previousUnitBeingCompleted = this . lookupEnvironment . unitBeingCompleted ; try { if ( previousUnitBeingCompleted == null ) { this . lookupEnvironment . unitBeingCompleted = HierarchyResolver . FakeUnit ; } ReferenceBinding typeBinding = this . typeBindings [ i ] ; typeBinding . superclass ( ) ; typeBinding . superInterfaces ( ) ; } catch ( AbortCompilation e ) { } finally { this . lookupEnvironment . unitBeingCompleted = previousUnitBeingCompleted ; } } } for ( int i = 0 ; i < unitsIndex ;

Fix:
IResource file = classFile . resource ( ) ;