Buggy code:
public class QualifiedTypeReference extends TypeReference { public char [ ] [ ] tokens ; public long [ ] sourcePositions ; public QualifiedTypeReference ( char [ ] [ ] sources , long [ ] poss ) { } public TypeReference copyDims ( int dim ) { } protected TypeBinding findNextTypeBinding ( int tokenIndex , Scope scope , PackageBinding packageBinding ) { } public char [ ] getLastToken ( ) { } protected TypeBinding getTypeBinding ( Scope scope ) { if ( ( this . resolvedType ) != null ) return this . resolvedType ; Binding binding = scope . getPackage ( this . tokens ) ; if ( ( binding != null ) && ( ! ( binding . isValidBinding ( ) ) ) ) return ( ( ReferenceBinding ) ( binding ) ) ; PackageBinding packageBinding = ( binding == null ) ? null : ( ( PackageBinding ) ( binding ) ) ; boolean isClassScope = ( scope . kind ) == ( Scope . CLASS_SCOPE ) ; ReferenceBinding qualifiedType = null ; for ( int i = ( packageBinding == null ) ? 0 : packageBinding . compoundName . length , max = this . tokens . length , last = max - 1 ; i < max ; i ++ ) { findNextTypeBinding ( i , scope , packageBinding ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) return this . resolvedType ; if ( ( ( i == 0 ) && ( this . resolvedType . isTypeVariable ( ) ) ) && ( ( ( ( TypeVariableBinding ) ( this . resolvedType ) ) . firstBound ) == null ) ) { scope . problemReporter ( ) . illegalAccessFromTypeVariable ( ( ( TypeVariableBinding ) ( this . resolvedType ) ) , this ) ; return this . resolvedType = null ; } if ( ( i < last ) && ( isTypeUseDeprecated ( this . resolvedType , scope ) ) ) { reportDeprecatedType ( this . resolvedType , scope ) ; } if ( isClassScope ) <START_BUG> if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( this . resolvedType , this , null ) ) <END_BUG> return null ; ReferenceBinding currentType = ( ( ReferenceBinding ) ( this . resolvedType ) ) ; if ( qualifiedType != null ) { boolean rawQualified ; if ( currentType . isGenericType ( ) ) { qualifiedType = scope . environment ( ) . createRawType ( currentType , qualifiedType ) ; } else if ( ( rawQualified = qualifiedType . isRawType ( ) ) && ( ! ( currentType . isStatic ( ) ) ) ) { qualifiedType = scope . environment ( ) . createRawType ( ( ( ReferenceBinding ) ( currentType . erasure ( ) ) ) , qualifiedType ) ; } else if ( ( rawQualified || ( qualifiedType . isParameterizedType ( ) ) ) && ( ( qualifiedType . erasure ( ) ) == ( currentType . enclosingType ( ) . erasure ( ) ) ) ) { qualifiedType = scope . environment ( ) . createParameterizedType ( ( ( ReferenceBinding ) ( currentType . erasure ( ) ) ) , null , qualifiedType ) ; } else { qualifiedType = currentType ; } } else { qualifiedType = ( currentType . isGenericType ( ) ) ? ( ( ReferenceBinding ) ( scope . environment ( ) . convertToRawType ( currentType ) ) ) : currentType ; } } this . resolvedType = qualifiedType ; return this . resolvedType ; } public char [ ] [ ] getTypeName ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( this . resolvedType , this ) )