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 ( FieldDeclaration field , TypeBinding type , int modifiers , ReferenceBinding declaringClass ) { } public FieldBinding ( FieldBinding initialFieldBinding , ReferenceBinding declaringClass ) { } public final int bindingType ( ) { } public final boolean canBeSeenBy ( TypeBinding receiverType , InvocationSite invocationSite , Scope scope ) { if ( isPublic ( ) ) return true ; SourceTypeBinding invocationType = scope . enclosingSourceType ( ) ; if ( ( invocationType == ( declaringClass ) ) && ( invocationType == receiverType ) ) return true ; if ( isProtected ( ) ) { if ( invocationType == ( declaringClass ) ) return true ; if ( ( invocationType . fPackage ) == ( declaringClass . fPackage ) ) return true ; ReferenceBinding currentType = invocationType ; int depth = 0 ; do { if ( declaringClass . isSuperclassOf ( currentType ) ) { if ( invocationSite . isSuperAccess ( ) ) { return true ; } if ( receiverType instanceof ArrayBinding ) { return false ; } if ( isStatic ( ) ) { if ( depth > 0 ) invocationSite . setDepth ( depth ) ; return true ; } if ( ( currentType == receiverType ) || ( currentType . isSuperclassOf ( ( ( ReferenceBinding ) ( receiverType ) ) ) ) ) { if ( depth > 0 ) invocationSite . setDepth ( depth ) ; return true ; } } depth ++ ; currentType = currentType . enclosingType ( ) ; } while ( currentType != null ) ; return false ; } if ( isPrivate ( ) ) { if ( receiverType != ( declaringClass ) ) return false ; if ( invocationType != ( declaringClass ) ) { ReferenceBinding outerInvocationType = invocationType ; ReferenceBinding temp = outerInvocationType . enclosingType ( ) ; while ( temp != null ) { outerInvocationType = temp ; temp = temp . enclosingType ( ) ; } <START_BUG> ReferenceBinding outerDeclaringClass = declaringClass ; <END_BUG> temp = outerDeclaringClass . enclosingType ( ) ; while ( temp != null ) { outerDeclaringClass = temp ; temp = temp . enclosingType ( ) ; } if ( outerInvocationType != outerDeclaringClass ) return false ; } return true ; } if ( ( invocationType . fPackage ) != ( declaringClass . fPackage ) ) return false ; if ( receiverType instanceof ArrayBinding ) return false ; ReferenceBinding currentType = ( ( ReferenceBinding ) ( receiverType ) ) ; PackageBinding declaringPackage = declaringClass . fPackage ; do { if ( ( declaringClass ) == currentType ) return true ; if ( declaringPackage != ( currentType . fPackage ) ) return false ; } while ( ( currentType = currentType . superclass ( ) ) != null ) ; return false ; } public char [ ] genericSignature ( ) { } public final int getAccessFlags ( ) { } public final boolean isDefault ( ) { } public final boolean isDeprecated ( ) { } public final boolean isPrivate ( ) { } public final boolean isPrivateUsed ( ) { } public final boolean isProtected ( ) { } public final boolean isPublic ( ) { } public final boolean isStatic ( ) { } public final boolean isSynthetic ( ) { } public final boolean isTransient ( ) { } public final boolean isViewedAsDeprecated ( ) { } public final boolean isVolatile ( ) { } }

Fix:
ReferenceBinding outerDeclaringClass = ( ( ReferenceBinding ) ( declaringClass . erasure ( ) ) ) ;