Program: 173972
Project: 173972
Buggy source:
/** 
 * @param text text to be convert to object
 * @param clazz target class type of object
 * @return target object
 * @throws ReflectiveOperationException when there is any exception during conversion
 */
private <T>T doToBean(final String text,final Class<T> clazz) throws ReflectiveOperationException {
  Field[] fields=clazz.getDeclaredFields();
  T bean=clazz.newInstance();
  String fieldName=null;
  if (fields.length == 1 && List.class.isAssignableFrom(fields[0].getType())) {
    fieldName=fields[0].getName().substring(0,1).toUpperCase() + fields[0].getName().substring(1);
    Class<?> genericClass=(Class<?>)((ParameterizedType)fields[0].getGenericType()).getActualTypeArguments()[0];
    List<Object> list=new ArrayList<Object>();
    String subText=text.substring(text.indexOf(associate) + 1);
    byte[] textBytes;
    try {
      textBytes=subText.getBytes(encoding.getCode());
      InputStream in=new ByteArrayInputStream(textBytes);
      BufferedReader br=new BufferedReader(new InputStreamReader(in));
      String subLine;
      while (null != (subLine=br.readLine())) {
        list.add(doToBean(subLine,genericClass));
      }
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    if (list.size() > 0) {
      Method method=clazz.getMethod("String_Node_Str" + fieldName,fields[0].getType());
      method.invoke(bean,list);
    }
  }
 else {
    String[] fieldTexts=text.split(separate);
    if (withname) {
      if (fieldTexts.length != fields.length) {
        throw new RuntimeException("String_Node_Str" + fieldTexts.length + "String_Node_Str"+ fields.length);
      }
      for (int i=0; i < fieldTexts.length; i++) {
        try {
          fields[i].setAccessible(true);
          fields[i].set(bean,baseTypeConvertor.toObject(fieldTexts[i],fields[i].getType()));
        }
 catch (        Exception e) {
          throw new ReflectiveOperationException(e);
        }
      }
    }
 else {
      for (      String fieldText : fieldTexts) {
        String[] fieldPair=null;
        int associatorIndex=fieldText.indexOf(associate);
        if (associatorIndex > 0 && associatorIndex < fieldText.length() - 1) {
          fieldPair=new String[2];
          fieldPair[0]=fieldText.substring(0,associatorIndex);
          fieldPair[1]=fieldText.substring(associatorIndex + 1);
          Field field=clazz.getDeclaredField(fieldPair[0].substring(0,1).toLowerCase() + fieldPair[0].substring(1));
          try {
            field.setAccessible(true);
            field.set(bean,baseTypeConvertor.toObject(fieldPair[1],field.getType()));
          }
 catch (          Exception e) {
            throw new ReflectiveOperationException(e);
          }
        }
 else         if (associatorIndex != fieldText.length() - 1) {
          throw new RuntimeException("String_Node_Str" + fieldText);
        }
      }
    }
  }
  return bean;
}

Fixed version (ground truth):
/** 
 * @param text text to be convert to object
 * @param clazz target class type of object
 * @return target object
 * @throws ReflectiveOperationException when there is any exception during conversion
 */
private <T>T doToBean(final String text,final Class<T> clazz) throws ReflectiveOperationException {
  Field[] fields=clazz.getDeclaredFields();
  T bean=clazz.newInstance();
  String fieldName=null;
  if (fields.length == 1 && List.class.isAssignableFrom(fields[0].getType())) {
    fieldName=fields[0].getName().substring(0,1).toUpperCase() + fields[0].getName().substring(1);
    Class<?> genericClass=(Class<?>)((ParameterizedType)fields[0].getGenericType()).getActualTypeArguments()[0];
    List<Object> list=new ArrayList<Object>();
    String subText=text.substring(text.indexOf(associator) + 1);
    byte[] textBytes;
    try {
      textBytes=subText.getBytes(encoding.getCode());
      InputStream in=new ByteArrayInputStream(textBytes);
      BufferedReader br=new BufferedReader(new InputStreamReader(in));
      String subLine;
      while (null != (subLine=br.readLine())) {
        list.add(doToBean(subLine,genericClass));
      }
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    if (list.size() > 0) {
      Method method=clazz.getMethod("String_Node_Str" + fieldName,fields[0].getType());
      method.invoke(bean,list);
    }
  }
 else {
    String[] fieldTexts=Strings.split(text,separator);
    if (withname) {
      for (      String fieldText : fieldTexts) {
        String[] fieldPair=null;
        int associatorIndex=fieldText.indexOf(associator);
        if (associatorIndex > 0 && associatorIndex < fieldText.length() - 1) {
          fieldPair=new String[2];
          fieldPair[0]=fieldText.substring(0,associatorIndex);
          fieldPair[1]=fieldText.substring(associatorIndex + 1);
          Field field=clazz.getDeclaredField(fieldPair[0].substring(0,1).toLowerCase() + fieldPair[0].substring(1));
          try {
            field.setAccessible(true);
            field.set(bean,baseTypeConvertor.toObject(fieldPair[1],field.getType()));
          }
 catch (          Exception e) {
            throw new ReflectiveOperationException(e);
          }
        }
 else         if (associatorIndex != fieldText.length() - 1) {
          throw new RuntimeException("String_Node_Str" + fieldText);
        }
      }
    }
 else {
      if (fieldTexts.length != fields.length) {
        for (int i=0; i < fieldTexts.length; i++) {
          System.out.println("String_Node_Str" + fieldTexts[i]);
        }
        throw new RuntimeException("String_Node_Str" + fieldTexts.length + "String_Node_Str"+ fields.length);
      }
      for (int i=0; i < fieldTexts.length; i++) {
        try {
          fields[i].setAccessible(true);
          fields[i].set(bean,baseTypeConvertor.toObject(fieldTexts[i],fields[i].getType()));
        }
 catch (        Exception e) {
          throw new ReflectiveOperationException(e);
        }
      }
    }
  }
  return bean;
}