Buggy code:
public class FieldBinding extends VariableBinding { public ReferenceBinding declaringClass ; protected FieldBinding ( ) { } public FieldBinding ( char [ ] name , TypeBinding type , int modifiers , ReferenceBinding declaringClass , Constant constant ) { } public FieldBinding ( FieldBinding initialFieldBinding , ReferenceBinding declaringClass ) { } public FieldBinding ( FieldDeclaration field , TypeBinding type , int modifiers , ReferenceBinding declaringClass ) { } public final boolean canBeSeenBy ( PackageBinding invocationPackage ) { } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( ( invocationType == ( this . declaringClass ) ) && ( invocationType == receiverType ) ) return true ; if ( invocationType == null ) return ( ! ( isPrivate ( ) ) ) && ( ( scope . getCurrentPackage ( ) ) == ( this . declaringClass . fPackage ) ) ; if ( isProtected ( ) ) { if ( invocationType == ( this . declaringClass ) ) return true ; if ( ( invocationType . fPackage ) == ( this . declaringClass . fPackage ) ) return true ; ReferenceBinding currentType = invocationType ; int depth = 0 ; ReferenceBinding receiverErasure = ( ( ReferenceBinding ) ( receiverType . erasure ( ) ) ) ; ReferenceBinding declaringErasure = ( ( ReferenceBinding ) ( this . declaringClass . erasure ( ) ) ) ; do { if ( ( currentType . findSuperTypeOriginatingFrom ( declaringErasure ) ) != null ) { if ( invocationSite . isSuperAccess ( ) ) return true ; if ( receiverType instanceof ArrayBinding ) return false ; if ( isStatic ( ) ) { if ( depth > 0 ) invocationSite . setDepth ( depth ) ; return true ; } if ( ( currentType == receiverErasure ) || ( ( receiverErasure . findSuperTypeOriginatingFrom ( currentType ) ) != null ) ) { if ( depth > 0 ) invocationSite . setDepth ( depth ) ; return true ; } } depth ++ ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { receiverCheck : { if ( receiverType != ( this . declaringClass ) ) { if ( ( receiverType . isTypeVariable ( ) ) && ( ( ( TypeVariableBinding ) ( receiverType ) ) . isErasureBoundTo ( this . declaringClass . erasure ( ) ) ) ) break receiverCheck ; return false ; } } if ( invocationType != ( this . declaringClass ) ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } ReferenceBinding outerDeclaringClass = ( ( ReferenceBinding ) ( this . declaringClass . erasure ( ) ) ) ; temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } PackageBinding declaringPackage = this . declaringClass . fPackage ; if ( ( invocationType . fPackage ) != declaringPackage ) return false ; if ( receiverType instanceof ArrayBinding ) return false ; TypeBinding originalDeclaringClass = this . declaringClass . original ( ) ; <START_BUG> ReferenceBinding currentType = ( ( ReferenceBinding ) ( receiverType ) ) ; <END_BUG> do { if ( originalDeclaringClass == ( currentType . original ( ) ) ) return true ; PackageBinding currentPackage = currentType . fPackage ; if ( ( currentPackage != null ) && ( currentPackage != declaringPackage ) ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public Constant constant ( ) { } public char [ ] genericSignature ( ) { } public final int getAccessFlags ( ) { } public AnnotationBinding [ ] getAnnotations ( ) { } public long getAnnotationTagBits ( ) { } public final boolean isDefault ( ) { } public final boolean isDeprecated ( ) { } public final boolean isPrivate ( ) { } public final boolean isOrEnclosedByPrivateType ( ) { } public final boolean isProtected ( ) { } public final boolean isPublic ( ) { } public final boolean isStatic ( ) { } public final boolean isSynthetic ( ) { } public final boolean isTransient ( ) { } public final boolean isUsed ( ) { } public final boolean isViewedAsDeprecated ( ) { } public final boolean isVolatile ( ) { } public final int kind ( ) { } public FieldBinding original ( ) { } public void setAnnotations ( AnnotationBinding [ ] annotations ) { } public FieldDeclaration sourceField ( ) { } }

Fix:
ReferenceBinding currentType = ( ( ReferenceBinding ) ( ( receiverType . isCapture ( ) ) ? receiverType . erasure ( ) : receiverType ) ) ;