Buggy code:
public ITypeBinding getDeclaringClass ( ) { } public int getDimensions ( ) { } public ITypeBinding getElementType ( ) { } public ITypeBinding getTypeDeclaration ( ) { } public ITypeBinding getErasure ( ) { } public ITypeBinding [ ] getInterfaces ( ) { } public IJavaElement getJavaElement ( ) { } private JavaElement getUnresolvedJavaElement ( ) { } private JavaElement getUnresolvedJavaElement ( org . eclipse . jdt . internal . compiler . lookup . TypeBinding typeBinding ) { if ( typeBinding == null ) return null ; switch ( typeBinding . kind ( ) ) { case Binding . ARRAY_TYPE : typeBinding = ( ( ArrayBinding ) ( typeBinding ) ) . leafComponentType ( ) ; return getUnresolvedJavaElement ( typeBinding ) ; case Binding . BASE_TYPE : case Binding . WILDCARD_TYPE : return null ; default : if ( typeBinding . isCapture ( ) ) return null ; } ReferenceBinding referenceBinding ; if ( ( typeBinding . isParameterizedType ( ) ) || ( typeBinding . isRawType ( ) ) ) referenceBinding = ( ( ReferenceBinding ) ( typeBinding . erasure ( ) ) ) ; else referenceBinding = ( ( ReferenceBinding ) ( typeBinding ) ) ; char [ ] fileName = referenceBinding . getFileName ( ) ; if ( ( referenceBinding . isLocalType ( ) ) || ( referenceBinding . isAnonymousType ( ) ) ) { if ( Util . isClassFileName ( fileName ) ) { int jarSeparator = CharOperation . indexOf ( IDependent . JAR_FILE_ENTRY_SEPARATOR , fileName ) ; int pkgEnd = CharOperation . lastIndexOf ( '//' , fileName ) ; if ( pkgEnd == ( - 1 ) ) pkgEnd = CharOperation . lastIndexOf ( File . separatorChar , fileName ) ; if ( ( jarSeparator != ( - 1 ) ) && ( pkgEnd < jarSeparator ) ) pkgEnd = jarSeparator ; if ( pkgEnd == ( - 1 ) ) return null ; IPackageFragment pkg = getPackageFragment ( fileName , pkgEnd , jarSeparator ) ; char [ ] constantPoolName = referenceBinding . constantPoolName ( ) ; if ( constantPoolName == null ) { ClassFile classFile = ( ( ClassFile ) ( getClassFile ( fileName ) ) ) ; return classFile == null ? null : ( ( JavaElement ) ( classFile . getType ( ) ) ) ; } pkgEnd = CharOperation . lastIndexOf ( '//' , constantPoolName ) ; char [ ] classFileName = CharOperation . subarray ( constantPoolName , ( pkgEnd + 1 ) , constantPoolName . length ) ; ClassFile classFile = ( ( ClassFile ) ( pkg . getClassFile ( ( ( new String ( classFileName ) ) + ( SuffixConstants . SUFFIX_STRING_class ) ) ) ) ) ; return ( ( JavaElement ) ( classFile . getType ( ) ) ) ; } ICompilationUnit cu = getCompilationUnit ( fileName ) ; if ( cu == null ) return null ; try { int sourceStart = ( ( LocalTypeBinding ) ( referenceBinding ) ) . sourceStart ; return ( ( JavaElement ) ( cu . getElementAt ( sourceStart ) ) ) ; } catch ( JavaModelException e ) { return null ; } } else if ( referenceBinding . isTypeVariable ( ) ) { final String typeVariableName = new String ( referenceBinding . sourceName ( ) ) ; Binding declaringElement = ( ( TypeVariableBinding ) ( referenceBinding ) ) . declaringElement ; IBinding declaringTypeBinding = null ; if ( declaringElement instanceof MethodBinding ) { declaringTypeBinding = this . resolver . getMethodBinding ( ( ( MethodBinding ) ( declaringElement ) ) ) ; IMethod declaringMethod = ( ( IMethod ) ( declaringTypeBinding . getJavaElement ( ) ) ) ; return ( ( JavaElement ) ( declaringMethod . getTypeParameter ( typeVariableName ) ) ) ; } else { ITypeBinding typeBinding2 = this . resolver . getTypeBinding ( ( ( org . eclipse . jdt . internal . compiler . lookup . TypeBinding ) ( declaringElement ) ) ) ; if ( typeBinding == null ) return null ; declaringTypeBinding = typeBinding2 ; IType declaringType = ( ( IType ) ( declaringTypeBinding . getJavaElement ( ) ) ) ; return ( ( JavaElement ) ( declaringType . getTypeParameter ( typeVariableName ) ) ) ; } } else { if ( fileName == null ) return null ; ITypeBinding declaringTypeBinding = null ; if ( this . isArray ( ) ) { <START_BUG> declaringTypeBinding = this . getComponentType ( ) . getDeclaringClass ( ) ; <END_BUG> } else { declaringTypeBinding = this . getDeclaringClass ( ) ; } if ( declaringTypeBinding == null ) { if ( Util . isClassFileName ( fileName ) ) { ClassFile classFile = ( ( ClassFile ) ( getClassFile ( fileName ) ) ) ; if ( classFile == null ) return null ; return ( ( JavaElement ) ( classFile . getType ( ) ) ) ; } ICompilationUnit cu = getCompilationUnit ( fileName ) ; if ( cu == null ) return null ; return ( ( JavaElement ) ( cu . getType ( new String ( referenceBinding . sourceName ( ) ) ) ) ) ; } else { IType declaringType = ( ( IType ) ( declaringTypeBinding . getJavaElement ( ) ) ) ; if ( declaringType == null ) return null ; return ( ( JavaElement ) ( declaringType . getType ( new String ( referenceBinding . sourceName ( ) ) ) ) ) ; } } } public String getKey ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public String getName ( ) { } public IPackageBinding getPackage ( ) { } private IPackageFragment getPackageFragment ( char [ ] fileName , int pkgEnd , int jarSeparator ) { } public String getQualifiedName ( ) { } public ITypeBinding getSuperclass ( ) { } public ITypeBinding [ ] getTypeArguments ( ) { } public ITypeBinding [ ] getTypeBounds ( ) { } public ITypeBinding [ ] getTypeParameters ( ) { }

Fix:
declaringTypeBinding = this . getElementType ( ) . getDeclaringClass ( ) ;