Buggy code:
public class IndexBasedHierarchyBuilder extends HierarchyBuilder implements SuffixConstants { public static final int MAXTICKS = 800 ; protected Map cuToHandle ; protected Map handleToWorkingCopy ; protected IJavaSearchScope scope ; protected Map binariesFromIndexMatches ; private static class Queue { public char [ ] [ ] names = new char [ 10 ] [ ] ; public int start = 0 ; public int end = - 1 ; public void add ( char [ ] name ) { } public char [ ] retrieve ( ) { } public String toString ( ) { } } public IndexBasedHierarchyBuilder ( TypeHierarchy hierarchy , IJavaSearchScope scope ) throws JavaModelException { } private void addInfoFromBinaryIndexMatch ( Openable handle , HierarchyBinaryType binaryType , ArrayList infos ) { } protected void addInfoFromClosedElement ( Openable handle , ArrayList infos , ArrayList units , String resourcePath ) { } private void addInfosFromType ( IType type , ArrayList infos ) throws JavaModelException { } public void build ( boolean computeSubtypes ) { } private void buildForProject ( JavaProject project , ArrayList infos , ArrayList units , ICompilationUnit [ ] workingCopies , IProgressMonitor monitor ) throws JavaModelException { IGenericType [ ] genericTypes ; int infosSize = infos . size ( ) ; if ( infosSize > 0 ) { genericTypes = new IGenericType [ infosSize ] ; infos . toArray ( genericTypes ) ; } else { genericTypes = new IGenericType [ 0 ] ; } org . eclipse . jdt . internal . compiler . env . ICompilationUnit [ ] compilationUnits ; int unitsSize = units . size ( ) ; if ( unitsSize > 0 ) { compilationUnits = new org . eclipse . jdt . internal . compiler . env . ICompilationUnit [ unitsSize ] ; units . toArray ( compilationUnits ) ; } else { compilationUnits = new org . eclipse . jdt . internal . compiler . env . ICompilationUnit [ 0 ] ; } if ( ( infosSize > 0 ) || ( unitsSize > 0 ) ) { this . searchableEnvironment = ( ( SearchableEnvironment ) ( project . getSearchableNameEnvironment ( ) ) ) ; IType focusType = this . getType ( ) ; this . nameLookup = project . getNameLookup ( ) ; boolean inProjectOfFocusType = ( focusType != null ) && ( focusType . getJavaProject ( ) . equals ( project ) ) ; if ( inProjectOfFocusType ) { ICompilationUnit unitToLookInside = focusType . getCompilationUnit ( ) ; ICompilationUnit [ ] unitsToLookInside ; if ( unitToLookInside != null ) { int wcLength = ( workingCopies == null ) ? 0 : workingCopies . length ; if ( wcLength == 0 ) { unitsToLookInside = new ICompilationUnit [ ] { unitToLookInside } ; } else { unitsToLookInside = new ICompilationUnit [ wcLength + 1 ] ; unitsToLookInside [ 0 ] = unitToLookInside ; System . arraycopy ( workingCopies , 0 , unitsToLookInside , 1 , wcLength ) ; } } else { unitsToLookInside = workingCopies ; } this . nameLookup . setUnitsToLookInside ( unitsToLookInside ) ; } try { this . hierarchyResolver = new HierarchyResolver ( this . searchableEnvironment , project . getOptions ( true ) , this , new DefaultProblemFactory ( ) ) ; if ( focusType != null ) { <START_BUG> Member declaringMember = ( ( Member ) ( focusType ) ) . getInnerMostDeclaringMember ( ) ; <END_BUG> if ( declaringMember == null ) { char [ ] fullyQualifiedName = focusType . getFullyQualifiedName ( ) . toCharArray ( ) ; ReferenceBinding focusTypeBinding = this . hierarchyResolver . setFocusType ( CharOperation . splitOn ( '.' , fullyQualifiedName ) ) ; if ( ( focusTypeBinding == null ) || ( ( ! inProjectOfFocusType ) && ( ( ( focusTypeBinding . tagBits ) & ( TagBits . HierarchyHasProblems ) ) > 0 ) ) ) { return ; } } else { this . hierarchyResolver . resolveLocalType ( focusType , declaringMember ) ; return ; } } this . hierarchyResolver . resolve ( genericTypes , compilationUnits , monitor ) ; } finally { if ( inProjectOfFocusType ) { this . nameLookup . setUnitsToLookInside ( null ) ; } } } } private void buildFromPotentialSubtypes ( String [ ] allPotentialSubTypes , IProgressMonitor monitor ) { } protected org . eclipse . jdt . internal . compiler . env . ICompilationUnit createCompilationUnitFromPath ( Openable handle , String osPath ) { } private String [ ] determinePossibleSubTypes ( IProgressMonitor monitor ) { } protected IType getHandle ( IGenericType genericType ) { } public static void searchAllPossibleSubTypes ( IType type , IJavaSearchScope scope , final Map binariesFromIndexMatches , final IPathRequestor pathRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) { } }

Fix:
Member declaringMember = ( ( Member ) ( focusType ) ) . getOuterMostLocalContext ( ) ;