Buggy code:
public class HierarchyResolver implements ITypeRequestor { IHierarchyRequestor requestor ; LookupEnvironment lookupEnvironment ; private int typeIndex ; private IGenericType [ ] typeModels ; private ReferenceBinding [ ] typeBindings ; private ReferenceBinding focusType ; public HierarchyResolver ( INameEnvironment nameEnvironment , IErrorHandlingPolicy policy , Map settings , IHierarchyRequestor requestor , IProblemFactory problemFactory ) { } public HierarchyResolver ( INameEnvironment nameEnvironment , IHierarchyRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } 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 ) { } public void resolve ( IGenericType [ ] suppliedTypes , ICompilationUnit [ ] sourceUnits ) { try { int suppliedLength = ( suppliedTypes == null ) ? 0 : suppliedTypes . length ; int sourceLength = ( sourceUnits == null ) ? 0 : sourceUnits . length ; CompilationUnitDeclaration [ ] units = new CompilationUnitDeclaration [ suppliedLength + sourceLength ] ; for ( int i = 0 ; i < suppliedLength ; i ++ ) { if ( suppliedTypes [ i ] . isBinaryType ( ) ) { IBinaryType binaryType = ( ( IBinaryType ) ( suppliedTypes [ i ] ) ) ; try { remember ( binaryType , lookupEnvironment . cacheBinaryType ( binaryType , false ) ) ; } catch ( AbortCompilation e ) { } } else { ISourceType topLevelType = ( ( ISourceType ) ( suppliedTypes [ i ] ) ) ; while ( ( topLevelType . getEnclosingType ( ) ) != null ) topLevelType = topLevelType . getEnclosingType ( ) ; CompilationResult result = new CompilationResult ( topLevelType . getFileName ( ) , i , suppliedLength ) ; units [ i ] = SourceTypeConverter . buildCompilationUnit ( new ISourceType [ ] { topLevelType } , false , true , lookupEnvironment . problemReporter , result ) ; if ( ( units [ i ] ) != null ) { try { lookupEnvironment . buildTypeBindings ( units [ i ] ) ; } catch ( AbortCompilation e ) { } } } } for ( int i = 0 ; i < sourceLength ; i ++ ) { ICompilationUnit sourceUnit = sourceUnits [ i ] ; CompilationResult unitResult = new CompilationResult ( sourceUnit , ( suppliedLength + i ) , ( suppliedLength + sourceLength ) ) ; CompilerOptions options = new CompilerOptions ( ) ; <START_BUG> Parser parser = new Parser ( lookupEnvironment . problemReporter , false , options . getAssertMode ( ) ) ; <END_BUG> CompilationUnitDeclaration parsedUnit = parser . dietParse ( sourceUnit , unitResult ) ; if ( parsedUnit != null ) { units [ ( suppliedLength + i ) ] = parsedUnit ; lookupEnvironment . buildTypeBindings ( parsedUnit ) ; } } 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 ) { } } } } 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 ) ; } } } reportHierarchy ( ) ; } catch ( ClassCastException e ) { } catch ( AbortCompilation e ) { } finally { reset ( ) ; } } public void resolve ( IGenericType suppliedType ) { } public void setFocusType ( char [ ] [ ] compoundName ) { } private boolean subOrSuperOfFocus ( ReferenceBinding typeBinding ) { } private boolean subTypeOfType ( ReferenceBinding subType , ReferenceBinding typeBinding ) { } }

Fix:
Parser parser = new Parser ( lookupEnvironment . problemReporter , false , options . assertMode ) ;