Buggy code:
public class HierarchyResolver implements ITypeRequestor { IHierarchyRequestor requestor ; LookupEnvironment lookupEnvironment ; private int typeIndex ; private IGenericType [ ] typeModels ; private ReferenceBinding [ ] typeBindings ; private ReferenceBinding focusType ; private CompilerOptions options ; private boolean hasMissingSuperClass ; public class MissingType implements IGenericType { public String simpleName ; public MissingType ( String simpleName ) { } public int getModifiers ( ) { } public boolean isBinaryType ( ) { } public boolean isClass ( ) { } public boolean isInterface ( ) { } public char [ ] getFileName ( ) { } public String toString ( ) { } } public HierarchyResolver ( INameEnvironment nameEnvironment , Map settings , IHierarchyRequestor requestor , IProblemFactory problemFactory ) { } public HierarchyResolver ( LookupEnvironment lookupEnvironment , IHierarchyRequestor requestor ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } private IGenericType findSuperClass ( IGenericType type , ReferenceBinding typeBinding ) { } private IGenericType [ ] findSuperInterfaces ( IGenericType type , ReferenceBinding typeBinding ) { } private void remember ( IGenericType suppliedType , ReferenceBinding typeBinding ) { } private void rememberWithMemberTypes ( TypeDeclaration typeDeclaration , HierarchyType enclosingType , ICompilationUnit unit ) { } private void rememberWithMemberTypes ( ISourceType suppliedType , ReferenceBinding typeBinding ) { } private void reportHierarchy ( ) { } private void reset ( ) { } public void resolve ( IGenericType [ ] suppliedTypes , IProgressMonitor monitor ) { } public void resolve ( IGenericType [ ] suppliedTypes , ICompilationUnit [ ] sourceUnits , IProgressMonitor monitor ) { try { int suppliedLength = ( suppliedTypes == null ) ? 0 : suppliedTypes . length ; int sourceLength = ( sourceUnits == null ) ? 0 : sourceUnits . length ; CompilationUnitDeclaration [ ] units = new CompilationUnitDeclaration [ suppliedLength + sourceLength ] ; BinaryTypeBinding [ ] binaryBindings = new BinaryTypeBinding [ suppliedLength ] ; for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( suppliedTypes [ i ] . isBinaryType ( ) ) { IBinaryType binaryType = ( ( IBinaryType ) ( suppliedTypes [ i ] ) ) ; try { binaryBindings [ i ] = lookupEnvironment . cacheBinaryType ( binaryType , false ) ; } catch ( AbortCompilation e ) { } } } for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( suppliedTypes [ i ] . isBinaryType ( ) ) { if ( ( binaryBindings [ i ] ) != null ) { try { remember ( ( ( IBinaryType ) ( suppliedTypes [ i ] ) ) , binaryBindings [ i ] ) ; } catch ( AbortCompilation e ) { } } } else { ISourceType topLevelType = ( ( ISourceType ) ( suppliedTypes [ i ] ) ) ; while ( ( topLevelType . getEnclosingType ( ) ) != null ) topLevelType = topLevelType . getEnclosingType ( ) ; CompilationResult result = new CompilationResult ( topLevelType . getFileName ( ) , i , suppliedLength , this . options . maxProblemsPerUnit ) ; units [ i ] = SourceTypeConverter . buildCompilationUnit ( new ISourceType [ ] { topLevelType } , false , true , false , lookupEnvironment . problemReporter , result ) ; if ( ( units [ i ] ) != null ) { try { lookupEnvironment . buildTypeBindings ( units [ i ] ) ; } catch ( AbortCompilation e ) { } } } worked ( monitor , 1 ) ; } <START_BUG> Parser parser = new Parser ( lookupEnvironment . problemReporter , true , options . sourceLevel ) ; <END_BUG> for ( int i = 0 ; i < sourceLength ; i ++ ) { ICompilationUnit sourceUnit = sourceUnits [ i ] ; 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 ; lookupEnvironment . buildTypeBindings ( parsedUnit ) ; } worked ( monitor , 1 ) ; } for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( ! ( suppliedTypes [ i ] . isBinaryType ( ) ) ) { CompilationUnitDeclaration parsedUnit = units [ i ] ; if ( parsedUnit != null ) { ISourceType topLevelType = ( ( ISourceType ) ( suppliedTypes [ i ] ) ) ; suppliedTypes [ i ] = null ; while ( ( topLevelType . getEnclosingType ( ) ) != null ) topLevelType = topLevelType . getEnclosingType ( ) ; try { lookupEnvironment . completeTypeBindings ( parsedUnit , false ) ; rememberWithMemberTypes ( topLevelType , parsedUnit . types [ 0 ] . binding ) ; } catch ( AbortCompilation e ) { } } } worked ( monitor , 1 ) ; } for ( int i = 0 ; i < sourceLength ; i ++ ) { CompilationUnitDeclaration parsedUnit = units [ ( suppliedLength + i ) ] ; if ( parsedUnit != null ) { lookupEnvironment . completeTypeBindings ( parsedUnit , false ) ; int typeCount = ( ( parsedUnit . types ) == null ) ? 0 : parsedUnit . types . length ; ICompilationUnit sourceUnit = sourceUnits [ i ] ; sourceUnits [ i ] = null ; for ( int j = 0 ; j < typeCount ; j ++ ) { rememberWithMemberTypes ( parsedUnit . types [ j ] , null , sourceUnit ) ; } } worked ( monitor , 1 ) ; } reportHierarchy ( ) ; } catch ( ClassCastException e ) { } catch ( AbortCompilation e ) { } finally { reset ( ) ; } }

Fix:
Parser parser = new Parser ( lookupEnvironment . problemReporter , true ) ;