Buggy code:
public abstract class Scope implements BaseTypes , BindingIds , CompilerModifiers , ProblemReasons , TagBits , TypeConstants , TypeIds { public Scope parent ; public int kind ; public static final int BLOCK_SCOPE = 1 ; public static final int METHOD_SCOPE = 2 ; public static final int CLASS_SCOPE = 3 ; public static final int COMPILATION_UNIT_SCOPE = 4 ; protected Scope ( int kind , Scope parent ) { } public abstract ProblemReporter problemReporter ( ) { } protected final boolean areParametersAssignable ( TypeBinding [ ] parameters , TypeBinding [ ] arguments ) { } public static boolean areTypesCompatible ( TypeBinding left , TypeBinding right ) { } public static int compareTypes ( TypeBinding left , TypeBinding right ) { } public int compareUncheckedException ( ReferenceBinding type ) { } public final CompilationUnitScope compilationUnitScope ( ) { } public ArrayBinding createArray ( TypeBinding type , int dimension ) { } 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 ) { } public final boolean isDefinedInSameUnit ( ReferenceBinding type ) { } public boolean isInsideDeprecatedCode ( ) { switch ( kind ) { case Scope . BLOCK_SCOPE : case Scope . METHOD_SCOPE : MethodScope methodScope = methodScope ( ) ; if ( ! ( methodScope . isInsideInitializer ( ) ) ) { MethodBinding context = ( ( AbstractMethodDeclaration ) ( methodScope . referenceContext ) ) . binding ; if ( ( context != null ) && ( context . isViewedAsDeprecated ( ) ) ) { return true ; } } else { SourceTypeBinding type = ( ( BlockScope ) ( this ) ) . referenceType ( ) . binding ; if ( ( methodScope . fieldDeclarationIndex ) != ( NotInFieldDecl ) ) { for ( int i = 0 ; i < ( type . fields . length ) ; i ++ ) { if ( ( type . fields [ i ] . id ) == ( methodScope . fieldDeclarationIndex ) ) { if ( type . fields [ i ] . isViewedAsDeprecated ( ) ) { return true ; } break ; } } } if ( ( type != null ) && ( type . isViewedAsDeprecated ( ) ) ) { return true ; } } break ; case Scope . CLASS_SCOPE : <START_BUG> ReferenceBinding context = ( ( BlockScope ) ( this ) ) . referenceType ( ) . binding ; <END_BUG> if ( ( context != null ) && ( context . isViewedAsDeprecated ( ) ) ) { return true ; } break ; } return false ; } public final boolean isJavaIoSerializable ( TypeBinding tb ) { } public final boolean isJavaLangCloneable ( TypeBinding tb ) { } public final boolean isJavaLangObject ( TypeBinding type ) { } public final MethodScope methodScope ( ) { } protected final MethodBinding mostSpecificClassMethodBinding ( MethodBinding [ ] visible , int visibleSize ) { } protected final MethodBinding mostSpecificInterfaceMethodBinding ( MethodBinding [ ] visible , int visibleSize ) { } public final ClassScope outerMostClassScope ( ) { } public final MethodScope outerMostMethodScope ( ) { } public final CompilationUnitDeclaration referenceCompilationUnit ( ) { } int startIndex ( ) { } }

Fix:
ReferenceBinding context = ( ( ClassScope ) ( this ) ) . referenceType ( ) . binding ;