Buggy code:
class TypeBinding implements ITypeBinding { private static final String NO_NAME = "" ; private static final ITypeBinding [ ] NO_TYPE_BINDINGS = new ITypeBinding [ 0 ] ; private static final IVariableBinding [ ] NO_VARIABLE_BINDINGS = new IVariableBinding [ 0 ] ; private static final IMethodBinding [ ] NO_METHOD_BINDINGS = new IMethodBinding [ 0 ] ; private org . eclipse . jdt . internal . compiler . lookup . TypeBinding binding ; private BindingResolver resolver ; private String key ; public TypeBinding ( BindingResolver resolver , org . eclipse . jdt . internal . compiler . lookup . TypeBinding binding ) { } public boolean isPrimitive ( ) { } public boolean isArray ( ) { } public ITypeBinding getElementType ( ) { } public int getDimensions ( ) { } public boolean isClass ( ) { } public boolean isInterface ( ) { } public boolean isTypeVariable ( ) { } public String getName ( ) { } public IPackageBinding getPackage ( ) { } public ITypeBinding getDeclaringClass ( ) { } public ITypeBinding getSuperclass ( ) { } public ITypeBinding [ ] getInterfaces ( ) { } public IJavaElement getJavaElement ( ) { if ( ( ( ( this . binding ) == null ) || ( this . binding . isArrayType ( ) ) ) || ( this . binding . isBaseType ( ) ) ) return null ; ReferenceBinding referenceBinding = ( ( ReferenceBinding ) ( this . binding ) ) ; if ( referenceBinding . isBinaryBinding ( ) ) { ClassFile classFile = ( ( ClassFile ) ( getClassFile ( referenceBinding . getFileName ( ) ) ) ) ; if ( classFile == null ) return null ; return classFile . getType ( ) ; } if ( ( referenceBinding . isLocalType ( ) ) || ( referenceBinding . isAnonymousType ( ) ) ) { ICompilationUnit cu = getCompilationUnit ( referenceBinding . getFileName ( ) ) ; if ( cu == null ) return null ; if ( ! ( ( this . resolver ) instanceof DefaultBindingResolver ) ) return null ; DefaultBindingResolver bindingResolver = ( ( DefaultBindingResolver ) ( this . resolver ) ) ; <START_BUG> ASTNode node = ( ( ASTNode ) ( bindingResolver . bindingsToAstNodes . get ( this ) ) ) ; <END_BUG> try { return cu . getElementAt ( node . getStartPosition ( ) ) ; } catch ( JavaModelException e ) { return null ; } } else { ITypeBinding declaringTypeBinding = getDeclaringClass ( ) ; if ( declaringTypeBinding == null ) { ICompilationUnit cu = getCompilationUnit ( referenceBinding . getFileName ( ) ) ; if ( cu == null ) return null ; return cu . getType ( new String ( referenceBinding . sourceName ( ) ) ) ; } else { IType declaringType = ( ( IType ) ( declaringTypeBinding . getJavaElement ( ) ) ) ; if ( declaringType == null ) return null ; return declaringType . getType ( new String ( referenceBinding . sourceName ( ) ) ) ; } } } public int getModifiers ( ) { } public int getDeclaredModifiers ( ) { } public boolean isTopLevel ( ) { } public boolean isNested ( ) { } public boolean isMember ( ) { } public boolean isLocal ( ) { } public boolean isAnonymous ( ) { } public ITypeBinding [ ] getDeclaredTypes ( ) { } public String getBinaryName ( ) { } private IClassFile getClassFile ( char [ ] fileName ) { } private ICompilationUnit getCompilationUnit ( char [ ] fileName ) { } private IPackageFragment getPackageFragment ( char [ ] fileName , int lastSlash ) { } public IVariableBinding [ ] getDeclaredFields ( ) { } public IMethodBinding [ ] getDeclaredMethods ( ) { } private boolean shouldBeRemoved ( MethodBinding methodBinding ) { } public boolean isFromSource ( ) { } public int getKind ( ) { } public boolean isDeprecated ( ) { } public boolean isSynthetic ( ) { } public String getKey ( ) { } public boolean isEqualTo ( IBinding other ) { } public boolean isNullType ( ) { } public String getQualifiedName ( ) { } public boolean isEnum ( ) { } public boolean isAnnotation ( ) { } public ITypeBinding [ ] getTypeParameters ( ) { } public ITypeBinding [ ] getTypeBounds ( ) { } public boolean isParameterizedType ( ) { } public ITypeBinding [ ] getTypeArguments ( ) { } public ITypeBinding getErasure ( ) { } public boolean isRawType ( ) { } public boolean isWildcardType ( ) { } public ITypeBinding getBound ( ) { } public boolean isUpperbound ( ) { } public String toString ( ) { } private String getNonRecursiveKey ( IMethodBinding methodBinding ) { } }

Fix:
ASTNode node = ( ( ASTNode ) ( bindingResolver . bindingTables . bindingsToAstNodes . get ( this ) ) ) ;