Program: 90463
Project: 90463
Buggy source:
/** 
 * 获取update PreparedStatement.
 * @param conn 数据库连接
 * @param entities 数据对象
 * @param tableIndex 分表下标
 * @return PreparedStatement
 * @throws SQLException
 */
public static Statement getUpdate(Connection conn,List<? extends Object> entities,int tableIndex) throws SQLException {
  Object entity=entities.get(0);
  String tableName=ReflectUtil.getTableName(entity,tableIndex);
  Statement st=conn.createStatement();
  Map<String,Object> entityProperty=null;
  for (  Object dbEntity : entities) {
    try {
      entityProperty=ReflectUtil.describe(dbEntity,true);
    }
 catch (    Exception e) {
      throw new SQLException("String_Node_Str",e);
    }
    EntityPK entityPk=ReflectUtil.getPkValue(dbEntity);
    StringBuilder pkWhereSql=new StringBuilder();
    for (int i=0; i < entityPk.getPkNames().length; i++) {
      pkWhereSql.append(entityPk.getPkNames()[i].getValue());
      pkWhereSql.append("String_Node_Str");
      pkWhereSql.append(entityPk.getPkValues()[i].getValueAsString());
      pkWhereSql.append("String_Node_Str");
    }
    pkWhereSql.delete(pkWhereSql.length() - 5,pkWhereSql.length());
    Set<Map.Entry<String,Object>> propertyEntrySet=entityProperty.entrySet();
    StringBuilder SQL=new StringBuilder("String_Node_Str" + tableName + "String_Node_Str");
    Object value=null;
    for (    Map.Entry<String,Object> propertyEntry : propertyEntrySet) {
      value=propertyEntry.getValue();
      SQL.append(propertyEntry.getKey()).append("String_Node_Str");
      SQL.append(formatValue(value));
      SQL.append("String_Node_Str");
    }
    SQL.deleteCharAt(SQL.length() - 1);
    SQL.append("String_Node_Str").append(pkWhereSql.toString());
    st.addBatch(SQL.toString());
    debugSQL(SQL.toString());
  }
  return st;
}

Fixed version (ground truth):
/** 
 * 获取update PreparedStatement.
 * @param conn 数据库连接
 * @param entities 数据对象
 * @param tableIndex 分表下标
 * @return PreparedStatement
 * @throws SQLException
 */
public static Statement getUpdate(Connection conn,List<? extends Object> entities,int tableIndex) throws SQLException {
  Object entity=entities.get(0);
  String tableName=ReflectUtil.getTableName(entity,tableIndex);
  Statement st=conn.createStatement();
  Map<String,Object> entityProperty=null;
  for (  Object dbEntity : entities) {
    try {
      entityProperty=ReflectUtil.describe(dbEntity,true);
    }
 catch (    Exception e) {
      throw new SQLException("String_Node_Str",e);
    }
    EntityPK entityPk=ReflectUtil.getPkValue(dbEntity);
    StringBuilder pkWhereSql=new StringBuilder();
    for (int i=0; i < entityPk.getPkNames().length; i++) {
      pkWhereSql.append(entityPk.getPkNames()[i].getValue());
      pkWhereSql.append("String_Node_Str");
      pkWhereSql.append(formatValue(entityPk.getPkValues()[i].getValue()));
      pkWhereSql.append("String_Node_Str");
    }
    pkWhereSql.delete(pkWhereSql.length() - 5,pkWhereSql.length());
    Set<Map.Entry<String,Object>> propertyEntrySet=entityProperty.entrySet();
    StringBuilder SQL=new StringBuilder("String_Node_Str" + tableName + "String_Node_Str");
    Object value=null;
    for (    Map.Entry<String,Object> propertyEntry : propertyEntrySet) {
      value=propertyEntry.getValue();
      SQL.append(propertyEntry.getKey()).append("String_Node_Str");
      SQL.append(formatValue(value));
      SQL.append("String_Node_Str");
    }
    SQL.deleteCharAt(SQL.length() - 1);
    SQL.append("String_Node_Str").append(pkWhereSql.toString());
    st.addBatch(SQL.toString());
    debugSQL(SQL.toString());
  }
  return st;
}