Program: 44157
Project: 44157
Buggy source:
private Object convertValueTo(Object value,Class targetClass){
  if (targetClass == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (value == null) {
    return null;
  }
  if (targetClass.equals(Object.class)) {
    return value;
  }
  Object convertedValue=null;
  if (targetClass.isAssignableFrom(value.getClass())) {
    convertedValue=value;
  }
 else   if (value instanceof String && Enum.class.isAssignableFrom(targetClass)) {
    convertedValue=Enum.valueOf((Class<Enum>)targetClass,(String)value);
  }
 else {
    TypeConverter typeConverter=null;
    if (typeConvertersByClass != null) {
      typeConverter=typeConvertersByClass.get(targetClass);
    }
    if (typeConverter != null) {
      convertedValue=typeConverter.fromJSON(value);
    }
 else     if (List.class.isInstance(value)) {
      List list=(List)value;
      if (targetClass.isArray()) {
        convertedValue=Array.newInstance(targetClass.getComponentType(),list.size());
        int idx=0;
        for (        Object o : list) {
          Array.set(convertedValue,idx++,o);
        }
      }
 else       if (targetClass.isAssignableFrom(HashSet.class)) {
        convertedValue=new HashSet(list);
      }
 else       if (targetClass.isAssignableFrom(LinkedHashSet.class)) {
        convertedValue=new LinkedHashSet(list);
      }
 else       if (targetClass.isAssignableFrom(TreeSet.class)) {
        convertedValue=new TreeSet(list);
      }
    }
    if (convertedValue == null) {
      convertedValue=ConvertUtils.convert(value.toString(),targetClass);
    }
  }
  return convertedValue;
}

Fixed version (ground truth):
private Object convertValueTo(Object value,Class targetClass){
  if (targetClass == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (value == null) {
    return null;
  }
  if (targetClass.equals(Object.class)) {
    return value;
  }
  Object convertedValue=null;
  if (targetClass.isAssignableFrom(value.getClass())) {
    convertedValue=value;
  }
 else   if (value instanceof String && Enum.class.isAssignableFrom(targetClass)) {
    convertedValue=Enum.valueOf((Class<Enum>)targetClass,(String)value);
  }
 else {
    TypeConverter typeConverter=null;
    if (typeConvertersByClass != null) {
      typeConverter=typeConvertersByClass.get(targetClass);
    }
    if (typeConverter != null) {
      convertedValue=typeConverter.fromJSON(value);
    }
 else     if (List.class.isInstance(value)) {
      List list=(List)value;
      if (targetClass.isArray()) {
        convertedValue=Array.newInstance(targetClass.getComponentType(),list.size());
        int idx=0;
        for (        Object o : list) {
          Array.set(convertedValue,idx++,o);
        }
      }
 else       if (targetClass.isAssignableFrom(HashSet.class)) {
        convertedValue=new HashSet(list);
      }
 else       if (targetClass.isAssignableFrom(LinkedHashSet.class)) {
        convertedValue=new LinkedHashSet(list);
      }
 else       if (targetClass.isAssignableFrom(TreeSet.class)) {
        convertedValue=new TreeSet(list);
      }
    }
    if (convertedValue == null) {
      convertedValue=ConvertUtils.convert(value,targetClass);
    }
  }
  return convertedValue;
}