Buggy code:
public class ClassScope extends Scope { public TypeDeclaration referenceContext ; public ClassScope ( Scope parent , TypeDeclaration context ) { } void buildAnonymousTypeBinding ( SourceTypeBinding enclosingType , ReferenceBinding supertype ) { } private void buildFields ( ) { } void buildFieldsAndMethods ( ) { } private LocalTypeBinding buildLocalType ( SourceTypeBinding enclosingType , PackageBinding packageBinding ) { } void buildLocalTypeBinding ( SourceTypeBinding enclosingType ) { } private void buildMethods ( ) { } SourceTypeBinding buildType ( SourceTypeBinding enclosingType , PackageBinding packageBinding ) { } private void checkAndSetModifiers ( ) { } private void checkAndSetModifiersForField ( FieldBinding fieldBinding , FieldDeclaration fieldDecl ) { } private void checkForInheritedMemberTypes ( SourceTypeBinding sourceType ) { } private void connectMemberTypes ( ) { } private boolean connectSuperclass ( ) { } private boolean connectSuperInterfaces ( ) { } void connectTypeHierarchy ( ) { } private void connectTypeHierarchyWithoutMembers ( ) { } private boolean detectCycle ( SourceTypeBinding sourceType , ReferenceBinding superType , TypeReference reference ) { } private ReferenceBinding findSupertype ( TypeReference typeReference ) { typeReference . aboutToResolve ( this ) ; char [ ] [ ] compoundName = typeReference . getTypeName ( ) ; <START_BUG> compilationUnitScope ( ) . recordReference ( compoundName ) ; <END_BUG> SourceTypeBinding sourceType = referenceContext . binding ; int size = compoundName . length ; int n = 1 ; ReferenceBinding superType ; if ( CharOperation . equals ( compoundName [ 0 ] , sourceType . sourceName ) ) { superType = sourceType ; } else { Binding typeOrPackage = parent . getTypeOrPackage ( compoundName [ 0 ] , ( ( TYPE ) | ( PACKAGE ) ) ) ; if ( ( typeOrPackage == null ) || ( ! ( typeOrPackage . isValidBinding ( ) ) ) ) { compilationUnitScope ( ) . addNamespaceReference ( new ProblemPackageBinding ( compoundName [ 0 ] , NotFound ) ) ; return new ProblemReferenceBinding ( compoundName [ 0 ] , ( typeOrPackage == null ? NotFound : typeOrPackage . problemId ( ) ) ) ; } boolean checkVisibility = false ; for ( ; n < size ; n ++ ) { if ( ! ( typeOrPackage instanceof PackageBinding ) ) break ; PackageBinding packageBinding = ( ( PackageBinding ) ( typeOrPackage ) ) ; compilationUnitScope ( ) . addNamespaceReference ( packageBinding ) ; typeOrPackage = packageBinding . getTypeOrPackage ( compoundName [ n ] ) ; if ( ( typeOrPackage == null ) || ( ! ( typeOrPackage . isValidBinding ( ) ) ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , 0 , ( n + 1 ) ) , ( typeOrPackage == null ? NotFound : typeOrPackage . problemId ( ) ) ) ; checkVisibility = true ; } if ( typeOrPackage instanceof PackageBinding ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , 0 , n ) , NotFound ) ; superType = ( ( ReferenceBinding ) ( typeOrPackage ) ) ; compilationUnitScope ( ) . recordTypeReference ( superType ) ; compilationUnitScope ( ) . addTypeReference ( superType ) ; if ( checkVisibility && ( n == size ) ) { if ( ! ( superType . canBeSeenBy ( sourceType . fPackage ) ) ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , 0 , n ) , NotVisible ) ; } } while ( true ) { if ( detectCycle ( sourceType , superType , typeReference ) ) return null ; if ( n >= size ) break ; char [ ] typeName = compoundName [ ( n ++ ) ] ; superType = findMemberType ( typeName , superType ) ; if ( superType == null ) return new ProblemReferenceBinding ( CharOperation . subarray ( compoundName , 0 , n ) , NotFound ) ; if ( ! ( superType . isValidBinding ( ) ) ) { superType . compoundName = CharOperation . subarray ( compoundName , 0 , n ) ; return superType ; } } return superType ; } public ProblemReporter problemReporter ( ) { } public TypeDeclaration referenceType ( ) { } public String toString ( ) { } }

Fix:
compilationUnitScope ( ) . recordQualifiedReference ( compoundName ) ;