Buggy code:
} catch ( AbortCompilation e ) { } } } for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( suppliedTypes [ i ] . isBinaryType ( ) ) { if ( ( binaryBindings [ i ] ) != null ) { try { remember ( suppliedTypes [ i ] , binaryBindings [ i ] ) ; } catch ( AbortCompilation e ) { } } } else { ISourceType topLevelType = ( ( ISourceType ) ( suppliedTypes [ i ] ) ) ; while ( ( topLevelType . getEnclosingType ( ) ) != null ) topLevelType = topLevelType . getEnclosingType ( ) ; boolean containsLocalType = false ; if ( localTypes == null ) { containsLocalType = false ; } else if ( topLevelType instanceof SourceTypeElementInfo ) { IPath path = ( ( SourceTypeElementInfo ) ( topLevelType ) ) . getHandle ( ) . getPath ( ) ; containsLocalType = localTypes . contains ( path . toString ( ) ) ; } CompilationResult result = new CompilationResult ( topLevelType . getFileName ( ) , i , suppliedLength , this . options . maxProblemsPerUnit ) ; if ( ! containsLocalType ) { units [ i ] = SourceTypeConverter . buildCompilationUnit ( new ISourceType [ ] { topLevelType } , true , true , false , this . lookupEnvironment . problemReporter , result ) ; } else { units [ i ] = ElementInfoConverter . buildCompilationUnit ( new SourceTypeElementInfo [ ] { ( ( SourceTypeElementInfo ) ( topLevelType ) ) } , true , this . lookupEnvironment . problemReporter , result ) ; units [ i ] . bits |= AstNode . HasAllMethodBodies ; hasLocalType [ i ] = true ; } if ( ( units [ i ] ) != null ) { try { this . lookupEnvironment . buildTypeBindings ( units [ i ] ) ; } catch ( AbortCompilation e ) { } } } worked ( monitor , 1 ) ; } Parser parser = new Parser ( this . lookupEnvironment . problemReporter , true ) ; for ( int i = 0 ; i < sourceLength ; i ++ ) { org . eclipse . jdt . core . ICompilationUnit closedCU = closedCUs [ i ] ; IResource file = closedCU . getResource ( ) ; String osPath = file . getLocation ( ) . toOSString ( ) ; ICompilationUnit sourceUnit = this . requestor . createCompilationUnitFromPath ( ( ( Openable ) ( closedCU ) ) , osPath ) ; CompilationResult unitResult = new CompilationResult ( sourceUnit , ( suppliedLength + i ) , ( suppliedLength + sourceLength ) , this . options . maxProblemsPerUnit ) ; CompilationUnitDeclaration parsedUnit = parser . dietParse ( sourceUnit , unitResult ) ; if ( parsedUnit != null ) { units [ ( suppliedLength + i ) ] = parsedUnit ; if ( localTypes == null ) { hasLocalType [ ( suppliedLength + i ) ] = false ; } else { IPath path = file . getFullPath ( ) ; hasLocalType [ ( suppliedLength + i ) ] = localTypes . contains ( path . toString ( ) ) ; } this . lookupEnvironment . buildTypeBindings ( parsedUnit ) ; } worked ( monitor , 1 ) ; } for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( ! ( suppliedTypes [ i ] . isBinaryType ( ) ) ) { CompilationUnitDeclaration parsedUnit = units [ i ] ; if ( parsedUnit != null ) { try { this . lookupEnvironment . completeTypeBindings ( parsedUnit , true ) ; } catch ( AbortCompilation e ) { } } } worked ( monitor , 1 ) ; } for ( int i = 0 ; i < sourceLength ; i ++ ) { CompilationUnitDeclaration parsedUnit = units [ ( suppliedLength + i ) ] ; if ( parsedUnit != null ) { try { boolean localType = hasLocalType [ ( suppliedLength + i ) ] ; if ( localType ) { parser . getMethodBodies ( parsedUnit ) ; } <START_BUG> this . lookupEnvironment . completeTypeBindings ( parsedUnit , localType ) ; <END_BUG> } catch ( AbortCompilation e ) { } } worked ( monitor , 1 ) ; } for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( ! ( suppliedTypes [ i ] . isBinaryType ( ) ) ) { CompilationUnitDeclaration parsedUnit = units [ i ] ; if ( parsedUnit != null ) { boolean localType = hasLocalType [ i ] ; if ( localType ) { parsedUnit . scope . faultInTypes ( ) ; parsedUnit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; parsedUnit . resolve ( ) ; } ISourceType topLevelType = ( ( ISourceType ) ( suppliedTypes [ i ] ) ) ; suppliedTypes [ i ] = null ; while ( ( topLevelType . getEnclosingType ( ) ) != null ) { topLevelType = topLevelType . getEnclosingType ( ) ; } org . eclipse . jdt . core . ICompilationUnit cu = ( ( SourceTypeElementInfo ) ( topLevelType ) ) . getHandle ( ) . getCompilationUnit ( ) ; rememberAllTypes ( parsedUnit , cu , localType ) ; } } } for ( int i = 0 ; i < sourceLength ; i ++ ) { CompilationUnitDeclaration parsedUnit = units [ ( suppliedLength + i ) ] ; if ( parsedUnit != null ) { boolean localType = hasLocalType [ ( suppliedLength + i ) ] ; if ( localType ) { parsedUnit . scope . faultInTypes ( ) ; parsedUnit . scope . verifyMethods ( this . lookupEnvironment . methodVerifier ( ) ) ; parsedUnit . resolve ( ) ; } rememberAllTypes ( parsedUnit , closedCUs [ i ] , localType ) ; } } reportHierarchy ( ) ; }

Fix:
this . lookupEnvironment . completeTypeBindings ( parsedUnit , true ) ;