Buggy code:
public final MethodScope enclosingMethodScope ( ) { } public final SourceTypeBinding enclosingSourceType ( ) { } public final LookupEnvironment environment ( ) { } public ReferenceBinding findDirectMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { } public MethodBinding findExactMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public FieldBinding findField ( TypeBinding receiverType , char [ ] fieldName , InvocationSite invocationSite ) { } public ReferenceBinding findMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { } public MethodBinding findMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public MethodBinding findDefaultAbstractMethod ( ReferenceBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite , ReferenceBinding classHierarchyStart , MethodBinding matchingMethod , ObjectVector found ) { } public MethodBinding findMethodInSuperInterfaces ( ReferenceBinding currentType , char [ ] selector , ObjectVector found , MethodBinding matchingMethod ) { } public MethodBinding findMethodForArray ( ArrayBinding receiverType , char [ ] selector , TypeBinding [ ] argumentTypes , InvocationSite invocationSite ) { } public ReferenceBinding findType ( char [ ] typeName , PackageBinding declarationPackage , PackageBinding invocationPackage ) { } public TypeBinding getBaseType ( char [ ] name ) { } public final PackageBinding getCurrentPackage ( ) { } public final ReferenceBinding getJavaIoSerializable ( ) { } public final ReferenceBinding getJavaLangClass ( ) { } public final ReferenceBinding getJavaLangCloneable ( ) { } public final ReferenceBinding getJavaLangError ( ) { } public final ReferenceBinding getJavaLangAssertionError ( ) { } public final ReferenceBinding getJavaLangObject ( ) { } public final ReferenceBinding getJavaLangRuntimeException ( ) { } public final ReferenceBinding getJavaLangString ( ) { } public final ReferenceBinding getJavaLangThrowable ( ) { } public final ReferenceBinding getMemberType ( char [ ] typeName , ReferenceBinding enclosingType ) { } public final TypeBinding getType ( char [ ] [ ] compoundName ) { } public final TypeBinding getType ( char [ ] name ) { } public final Binding getTypeOrPackage ( char [ ] [ ] compoundName ) { } final Binding getTypeOrPackage ( char [ ] name , int mask ) { Scope scope = this ; ReferenceBinding foundType = null ; if ( ( mask & ( TypeConstants . TYPE ) ) == 0 ) { Scope next = scope ; while ( ( next = scope . parent ) != null ) scope = next ; } else { done : while ( true ) { switch ( scope . kind ) { case Scope . METHOD_SCOPE : case Scope . BLOCK_SCOPE : ReferenceBinding localType = ( ( BlockScope ) ( scope ) ) . findLocalType ( name ) ; if ( localType != null ) { if ( ( foundType != null ) && ( foundType != localType ) ) return new ProblemReferenceBinding ( name , ProblemReasons . InheritedNameHidesEnclosingName ) ; return localType ; } break ; case Scope . CLASS_SCOPE : SourceTypeBinding sourceType = ( ( ClassScope ) ( scope ) ) . referenceContext . binding ; ReferenceBinding memberType = findMemberType ( name , sourceType ) ; if ( memberType != null ) { if ( ( memberType . problemId ( ) ) == ( ProblemReasons . Ambiguous ) ) { if ( ( foundType == null ) || ( ( foundType . problemId ( ) ) == ( ProblemReasons . NotVisible ) ) ) return memberType ; else return new ProblemReferenceBinding ( name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } if ( memberType . isValidBinding ( ) ) { if ( ( sourceType == ( memberType . enclosingType ( ) ) ) || ( ( environment ( ) . options . complianceLevel ) >= ( JDK1_4 ) ) ) { if ( foundType == null ) return memberType ; if ( foundType . isValidBinding ( ) ) if ( foundType != memberType ) return new ProblemReferenceBinding ( name , ProblemReasons . InheritedNameHidesEnclosingName ) ; } } if ( ( foundType == null ) || ( ( ( foundType . problemId ( ) ) == ( ProblemReasons . NotVisible ) ) && ( ( memberType . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) ) ) foundType = memberType ; } if ( CharOperation . equals ( sourceType . sourceName , name ) ) { <START_BUG> if ( ( foundType != null ) && ( foundType != sourceType ) ) <END_BUG> 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 ) ) ; if ( ( mask & ( TypeConstants . TYPE ) ) != 0 ) { ImportBinding [ ] imports = unitScope . imports ; if ( imports != null ) { 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 ) ) if ( ( unitScope . resolveSingleTypeImport ( typeImport ) ) != null ) { if ( ( typeImport . reference ) != null ) typeImport . reference . used = true ; return typeImport . resolvedImport ; } } } ReferenceBinding type = findType ( name , unitScope . fPackage , unitScope . fPackage ) ; if ( type != null ) return type ; boolean foundInImport = false ; if ( imports != null ) { for ( int i = 0 , length = imports . length ;

Fix:
if ( ( ( foundType != null ) && ( foundType != sourceType ) ) && ( ( foundType . problemId ( ) ) != ( ProblemReasons . NotVisible ) ) )