Buggy code:
public class ParameterizedSingleTypeReference extends ArrayTypeReference { public TypeReference [ ] typeArguments ; private boolean didResolve = false ; public ParameterizedSingleTypeReference ( char [ ] name , TypeReference [ ] typeArguments , int dim , long pos ) { } public void checkBounds ( Scope scope ) { } public TypeReference copyDims ( int dim ) { } public char [ ] [ ] getParameterizedTypeName ( ) { } protected TypeBinding getTypeBinding ( Scope scope ) { } private TypeBinding internalResolveType ( Scope scope , ReferenceBinding enclosingType , boolean checkBounds ) { this . constant = NotAConstant ; if ( this . didResolve ) { if ( ( ( this . resolvedType ) != null ) && ( ! ( this . resolvedType . isValidBinding ( ) ) ) ) return null ; return this . resolvedType ; } this . didResolve = true ; if ( enclosingType == null ) { this . resolvedType = scope . getType ( token ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { reportInvalidType ( scope ) ; return null ; } enclosingType = this . resolvedType . enclosingType ( ) ; if ( enclosingType != null ) { ReferenceBinding currentType = ( ( ReferenceBinding ) ( this . resolvedType ) ) ; if ( ( currentType . isStatic ( ) ) && ( ( enclosingType . isGenericType ( ) ) || ( enclosingType . isParameterizedType ( ) ) ) ) { enclosingType = scope . environment ( ) . createRawType ( ( ( ReferenceBinding ) ( enclosingType . erasure ( ) ) ) , enclosingType . enclosingType ( ) ) ; } } } else { this . resolvedType = scope . getMemberType ( token , ( ( ReferenceBinding ) ( enclosingType . erasure ( ) ) ) ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { scope . problemReporter ( ) . invalidEnclosingType ( this , this . resolvedType , enclosingType ) ; return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) scope . problemReporter ( ) . deprecatedType ( this . resolvedType , this ) ; } boolean isClassScope = ( scope . kind ) == ( Scope . CLASS_SCOPE ) ; ReferenceBinding currentType = ( ( ReferenceBinding ) ( this . resolvedType ) ) ; int argLength = this . typeArguments . length ; TypeBinding [ ] argTypes = new TypeBinding [ argLength ] ; boolean argHasError = false ; for ( int i = 0 ; i < argLength ; i ++ ) { TypeReference typeArgument = this . typeArguments [ i ] ; TypeBinding argType = ( isClassScope ) ? typeArgument . resolveTypeArgument ( ( ( ClassScope ) ( scope ) ) , currentType , i ) : typeArgument . resolveTypeArgument ( ( ( BlockScope ) ( scope ) ) , currentType , i ) ; if ( argType == null ) { argHasError = true ; } else { argTypes [ i ] = argType ; } } if ( argHasError ) return null ; if ( isClassScope ) <START_BUG> if ( ( ( ClassScope ) ( scope ) ) . detectCycle ( currentType , this , argTypes ) ) <END_BUG> return null ; TypeVariableBinding [ ] typeVariables = currentType . typeVariables ( ) ; if ( typeVariables == ( NoTypeVariables ) ) { scope . problemReporter ( ) . nonGenericTypeCannotBeParameterized ( this , currentType , argTypes ) ; return null ; } else if ( argLength != ( typeVariables . length ) ) { scope . problemReporter ( ) . incorrectArityForParameterizedType ( this , currentType , argTypes ) ; return null ; } checkGeneric : { for ( int i = 0 ; i < argLength ; i ++ ) if ( ( typeVariables [ i ] ) != ( argTypes [ i ] ) ) break checkGeneric ; return currentType ; } ParameterizedTypeBinding parameterizedType = scope . createParameterizedType ( ( ( ReferenceBinding ) ( currentType . erasure ( ) ) ) , argTypes , enclosingType ) ; if ( checkBounds ) for ( int i = 0 ; i < argLength ; i ++ ) if ( ! ( typeVariables [ i ] . boundCheck ( parameterizedType , argTypes [ i ] ) ) ) scope . problemReporter ( ) . typeMismatchError ( argTypes [ i ] , typeVariables [ i ] , currentType , this . typeArguments [ i ] ) ; this . resolvedType = parameterizedType ; if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) reportDeprecatedType ( scope ) ; if ( ( this . dimensions ) > 0 ) { if ( ( dimensions ) > 255 ) scope . problemReporter ( ) . tooManyDimensions ( this ) ; this . resolvedType = scope . createArrayType ( parameterizedType , dimensions ) ; } return this . resolvedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope , boolean checkBounds ) { } public TypeBinding resolveType ( ClassScope scope ) { } public TypeBinding resolveTypeEnclosing ( BlockScope scope , ReferenceBinding enclosingType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
if ( ( ( ClassScope ) ( scope ) ) . detectHierarchyCycle ( currentType , this , argTypes ) )