Program: 32372
Project: 32372
Buggy source:
void computeJavaReturnVarTypes(TypeCast cast) throws InternalException {
  Class<?> retType=getMethodReturnType();
  if (retType.equals(Iterator.class)) {
    Type genRetType=method.getGenericReturnType();
    if (!(genRetType instanceof ParameterizedType)) {
      String msg="String_Node_Str";
      throw new InternalException(msg);
    }
    Type paramType=((ParameterizedType)genRetType).getActualTypeArguments()[0];
    if (paramType instanceof GenericArrayType) {
      Type compType=((GenericArrayType)paramType).getGenericComponentType();
      retType=(Class<?>)compType;
      computeJavaArrayReturnVarTypes(cast,retType);
    }
 else {
      retType=(Class<?>)paramType;
      retType=doTypeCast(cast,retType);
      Variable v=getReturns().get(0);
      v.setType(retType);
    }
  }
 else   if (TIterator.class.isAssignableFrom(retType)) {
    String msg="String_Node_Str" + name;
    if (getReturns().size() != 1)     throw new InternalException(msg);
    Variable v=(Variable)getReturns().get(0);
    if (retType.equals(TIntIterator.class))     v.setType(doTypeCast(cast,int.class));
 else     if (retType.equals(TLongIterator.class))     v.setType(doTypeCast(cast,long.class));
 else     if (retType.equals(TFloatIterator.class))     v.setType(doTypeCast(cast,float.class));
 else     if (retType.equals(TDoubleIterator.class))     v.setType(doTypeCast(cast,double.class));
 else     throw new InternalException(msg);
  }
 else   if (retType.isArray()) {
    computeJavaArrayReturnVarTypes(cast,retType);
  }
 else {
    if (getReturns().size() != 1)     throw new InternalException("String_Node_Str" + name);
    Variable v=(Variable)getReturns().get(0);
    retType=doTypeCast(cast,retType);
    v.setType(retType);
  }
}

Fixed version (ground truth):
void computeJavaReturnVarTypes(TypeCast cast) throws InternalException {
  Class<?> retType=getMethodReturnType();
  if (retType.equals(Iterator.class)) {
    Type genRetType=method.getGenericReturnType();
    if (!(genRetType instanceof ParameterizedType)) {
      String msg="String_Node_Str";
      throw new InternalException(msg);
    }
    Type paramType=((ParameterizedType)genRetType).getActualTypeArguments()[0];
    if (paramType instanceof GenericArrayType) {
      Type compType=((GenericArrayType)paramType).getGenericComponentType();
      retType=(Class<?>)compType;
      computeJavaArrayReturnVarTypes(cast,retType);
    }
 else {
      retType=(Class<?>)paramType;
      if (retType.isArray() && getReturns().size() >= 2) {
        computeJavaArrayReturnVarTypes(cast,retType);
      }
 else {
        retType=doTypeCast(cast,retType);
        Variable v=getReturns().get(0);
        v.setType(retType);
      }
    }
  }
 else   if (TIterator.class.isAssignableFrom(retType)) {
    String msg="String_Node_Str" + name;
    if (getReturns().size() != 1)     throw new InternalException(msg);
    Variable v=(Variable)getReturns().get(0);
    if (retType.equals(TIntIterator.class))     v.setType(doTypeCast(cast,int.class));
 else     if (retType.equals(TLongIterator.class))     v.setType(doTypeCast(cast,long.class));
 else     if (retType.equals(TFloatIterator.class))     v.setType(doTypeCast(cast,float.class));
 else     if (retType.equals(TDoubleIterator.class))     v.setType(doTypeCast(cast,double.class));
 else     throw new InternalException(msg);
  }
 else   if (retType.isArray()) {
    computeJavaArrayReturnVarTypes(cast,retType);
  }
 else {
    if (getReturns().size() != 1)     throw new InternalException("String_Node_Str" + name);
    Variable v=(Variable)getReturns().get(0);
    retType=doTypeCast(cast,retType);
    v.setType(retType);
  }
}