Buggy code:
} } if ( ( foundType == null ) || ( ( ( foundType . problemId ( ) ) == ( ProblemReasons . NotVisible ) ) && ( ( memberType . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) ) ) foundType = memberType ; } } insideTypeAnnotation = false ; if ( CharOperation . equals ( sourceType . sourceName , name ) ) { if ( ( ( foundType != null ) && ( foundType != sourceType ) ) && ( ( foundType . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) ) return new ProblemReferenceBinding ( name , ProblemReasons . InheritedNameHidesEnclosingName ) ; return sourceType ; } break ; case Scope . COMPILATION_UNIT_SCOPE : break done ; } scope = scope . parent ; } if ( ( foundType != null ) && ( ( foundType . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) ) return foundType ; } CompilationUnitScope unitScope = ( ( CompilationUnitScope ) ( scope ) ) ; PackageBinding currentPackage = unitScope . fPackage ; if ( ( mask & ( Binding . TYPE ) ) != 0 ) { ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { HashtableOfObject typeImports = unitScope . resolvedSingeTypeImports ; if ( typeImports != null ) { Object typeImport = typeImports . get ( name ) ; if ( typeImport != null ) { if ( typeImport instanceof ReferenceBinding ) return ( ( ReferenceBinding ) ( typeImport ) ) ; ImportReference importReference = ( ( ImportBinding ) ( typeImport ) ) . reference ; if ( importReference != null ) importReference . used = true ; return ( ( ImportBinding ) ( typeImport ) ) . resolvedImport ; } } else { for ( int i = 0 , length = imports . length ; i < length ; i ++ ) { ImportBinding typeImport = imports [ i ] ; if ( ! ( typeImport . onDemand ) ) { if ( CharOperation . equals ( typeImport . compoundName [ ( ( typeImport . compoundName . length ) - 1 ) ] , name ) ) { Binding resolvedImport = unitScope . resolveSingleImport ( typeImport ) ; if ( ( resolvedImport != null ) && ( resolvedImport instanceof TypeBinding ) ) { ImportReference importReference = typeImport . reference ; if ( importReference != null ) importReference . used = true ; return resolvedImport ; } } } } } } unitScope . recordReference ( currentPackage . compoundName , name ) ; Binding binding = currentPackage . getTypeOrPackage ( name ) ; if ( binding instanceof ReferenceBinding ) return binding ; if ( imports != null ) { boolean foundInImport = false ; ReferenceBinding type = null ; for ( int i = 0 , length = imports . length ; i < length ; i ++ ) { ImportBinding someImport = imports [ i ] ; if ( someImport . onDemand ) { Binding resolvedImport = someImport . resolvedImport ; ReferenceBinding temp = ( resolvedImport instanceof PackageBinding ) ? findType ( name , ( ( PackageBinding ) ( resolvedImport ) ) , currentPackage ) : someImport . isStatic ( ) ? findMemberType ( name , ( ( ReferenceBinding ) ( resolvedImport ) ) ) : findDirectMemberType ( name , ( ( ReferenceBinding ) ( resolvedImport ) ) ) ; if ( temp != null ) { if ( temp . isValidBinding ( ) ) { ImportReference importReference = someImport . reference ; if ( importReference != null ) importReference . used = true ; if ( foundInImport ) return new ProblemReferenceBinding ( name , ProblemReasons . Ambiguous ) ; type = temp ; foundInImport = true ; } else if ( foundType == null ) { foundType = temp ; } } } } if ( type != null ) { if ( ( unitScope . resolvedSingeTypeImports ) != null ) <START_BUG> unitScope . resolvedSingeTypeImports . put ( type . compoundName [ ( ( type . compoundName . length ) - 1 ) ] , type ) ; <END_BUG> return type ; } } } unitScope . recordSimpleReference ( name ) ; if ( ( mask & ( Binding . PACKAGE ) ) != 0 ) { PackageBinding packageBinding = unitScope . environment . getTopLevelPackage ( name ) ; if ( packageBinding != null ) return packageBinding ; } if ( foundType != null ) return foundType ; return new ProblemReferenceBinding ( name , ProblemReasons . NotFound ) ; } public final Binding getTypeOrPackage ( char [ ] [ ] compoundName ) { } public static TypeBinding [ ] greaterLowerBound ( TypeBinding [ ] types ) { } public static ReferenceBinding [ ] greaterLowerBound ( ReferenceBinding [ ] types ) { } public CaseStatement innermostSwitchCase ( ) { } public boolean isBoxingCompatibleWith ( TypeBinding left , TypeBinding right ) { } public final boolean isDefinedInField ( FieldBinding field ) { } public final boolean isDefinedInMethod ( MethodBinding method ) { } public final boolean isDefinedInSameUnit ( ReferenceBinding type ) { } public final boolean isDefinedInType ( ReferenceBinding type ) { } public boolean isInsideCase ( CaseStatement caseStatement ) { } public boolean isInsideDeprecatedCode ( ) { } private TypeBinding leastContainingInvocation ( TypeBinding mec , Set invocations , List lubStack ) { } private TypeBinding leastContainingTypeArgument ( TypeBinding u , TypeBinding v , ReferenceBinding genericType , int rank , List lubStack ) { } public TypeBinding lowerUpperBound ( TypeBinding [ ] types ) { } private TypeBinding lowerUpperBound ( TypeBinding [ ] types , List lubStack ) { } public final MethodScope methodScope ( ) { } private TypeBinding [ ] minimalErasedCandidates ( TypeBinding [ ] types , Map allInvocations ) { } protected final MethodBinding mostSpecificClassMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { } protected final MethodBinding mostSpecificInterfaceMethodBinding ( MethodBinding [ ] visible , int visibleSize , InvocationSite invocationSite ) { }

Fix:
unitScope . resolvedSingeTypeImports . put ( name , type ) ;