Program: 9120
Project: 9120
Buggy source:
/** 
 * Resolve to a ReferenceType - simple, raw, parameterized, or generic. Raw, parameterized, and generic versions of a type share a delegate.
 */
private final ResolvedType resolveToReferenceType(UnresolvedType ty,boolean allowMissing){
  if (ty.isParameterizedType()) {
    ResolvedType rt=resolveGenericTypeFor(ty,allowMissing);
    if (rt.isMissing()) {
      return rt;
    }
    ReferenceType genericType=(ReferenceType)rt;
    ReferenceType parameterizedType=TypeFactory.createParameterizedType(genericType,ty.typeParameters,this);
    return parameterizedType;
  }
 else   if (ty.isGenericType()) {
    ResolvedType rt=resolveGenericTypeFor(ty,false);
    ReferenceType genericType=(ReferenceType)rt;
    return genericType;
  }
 else   if (ty.isGenericWildcard()) {
    return resolveGenericWildcardFor((WildcardedUnresolvedType)ty);
  }
 else {
    String erasedSignature=ty.getErasureSignature();
    ReferenceType simpleOrRawType=new ReferenceType(erasedSignature,this);
    if (ty.needsModifiableDelegate()) {
      simpleOrRawType.setNeedsModifiableDelegate(true);
    }
    ReferenceTypeDelegate delegate=resolveDelegate(simpleOrRawType);
    if (delegate == null) {
      return new MissingResolvedTypeWithKnownSignature(ty.getSignature(),erasedSignature,this);
    }
    if (delegate.isGeneric() && behaveInJava5Way) {
      simpleOrRawType.typeKind=TypeKind.RAW;
      if (simpleOrRawType.hasNewInterfaces()) {
        throw new IllegalStateException("String_Node_Str" + simpleOrRawType.getName());
      }
      ReferenceType genericType=makeGenericTypeFrom(delegate,simpleOrRawType);
      simpleOrRawType.setDelegate(delegate);
      genericType.setDelegate(delegate);
      simpleOrRawType.setGenericType(genericType);
      return simpleOrRawType;
    }
 else {
      simpleOrRawType.setDelegate(delegate);
      return simpleOrRawType;
    }
  }
}

Fixed version (ground truth):
/** 
 * Resolve to a ReferenceType - simple, raw, parameterized, or generic. Raw, parameterized, and generic versions of a type share a delegate.
 */
private final ResolvedType resolveToReferenceType(UnresolvedType ty,boolean allowMissing){
  if (ty.isParameterizedType()) {
    ResolvedType rt=resolveGenericTypeFor(ty,allowMissing);
    if (rt.isMissing()) {
      return rt;
    }
    ReferenceType genericType=(ReferenceType)rt;
    ReferenceType parameterizedType=TypeFactory.createParameterizedType(genericType,ty.typeParameters,this);
    return parameterizedType;
  }
 else   if (ty.isGenericType()) {
    ResolvedType rt=resolveGenericTypeFor(ty,false);
    ReferenceType genericType=(ReferenceType)rt;
    if (rt.isMissing()) {
      return rt;
    }
    return genericType;
  }
 else   if (ty.isGenericWildcard()) {
    return resolveGenericWildcardFor((WildcardedUnresolvedType)ty);
  }
 else {
    String erasedSignature=ty.getErasureSignature();
    ReferenceType simpleOrRawType=new ReferenceType(erasedSignature,this);
    if (ty.needsModifiableDelegate()) {
      simpleOrRawType.setNeedsModifiableDelegate(true);
    }
    ReferenceTypeDelegate delegate=resolveDelegate(simpleOrRawType);
    if (delegate == null) {
      return new MissingResolvedTypeWithKnownSignature(ty.getSignature(),erasedSignature,this);
    }
    if (delegate.isGeneric() && behaveInJava5Way) {
      simpleOrRawType.typeKind=TypeKind.RAW;
      if (simpleOrRawType.hasNewInterfaces()) {
        throw new IllegalStateException("String_Node_Str" + simpleOrRawType.getName());
      }
      ReferenceType genericType=makeGenericTypeFrom(delegate,simpleOrRawType);
      simpleOrRawType.setDelegate(delegate);
      genericType.setDelegate(delegate);
      simpleOrRawType.setGenericType(genericType);
      return simpleOrRawType;
    }
 else {
      simpleOrRawType.setDelegate(delegate);
      return simpleOrRawType;
    }
  }
}