nus-yam/ex-repair huggingface dataset:
Program: 90385
Project: 90385
Buggy source:
@Override public List<IDBResource> getAllSlaveShardingDBResource(Class<?> clazz,EnumDBMasterSlave masterSlave) throws SQLException, DBClusterException {
  List<IDBResource> dbResources=new ArrayList<IDBResource>();
  int tableNum=entityMetaManager.getTableNum(clazz);
  if (tableNum == 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  String clusterName=entityMetaManager.getClusterName(clazz);
  String tableName=entityMetaManager.getTableName(clazz);
  IDBResource dbResource=null;
  DBClusterInfo dbClusterInfo=this.getDBClusterInfo(clusterName);
  for (  DBRegionInfo region : dbClusterInfo.getDbRegions()) {
    List<DBInfo> slaveDBInfos=null;
    if (EnumDBMasterSlave.AUTO == masterSlave) {
      slaveDBInfos=region.getSlaveDBInfos().get(r.nextInt(region.getSlaveDBInfos().size() - 1));
    }
 else {
      slaveDBInfos=region.getSlaveDBInfos().get(masterSlave.getValue());
    }
    if (slaveDBInfos == null || slaveDBInfos.isEmpty()) {
      throw new DBClusterException("String_Node_Str" + clusterName);
    }
    for (    DBInfo dbInfo : slaveDBInfos) {
      for (int tableIndex=0; tableIndex < tableNum; tableIndex++) {
        dbResource=ShardingDBResource.valueOf(dbInfo,region,tableName,tableIndex);
        dbResources.add(dbResource);
      }
    }
  }
  return dbResources;
}

Fixed version (ground truth):
@Override public List<IDBResource> getAllSlaveShardingDBResource(Class<?> clazz,EnumDBMasterSlave masterSlave) throws SQLException, DBClusterException, SystemException {
  List<IDBResource> dbResources=new ArrayList<IDBResource>();
  int tableNum=entityMetaManager.getTableNum(clazz);
  if (tableNum == 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  String clusterName=entityMetaManager.getClusterName(clazz);
  String tableName=entityMetaManager.getTableName(clazz);
  ITransaction tx=(ITransaction)txManager.getTransaction();
  IDBResource dbResource=null;
  DBClusterInfo dbClusterInfo=this.getDBClusterInfo(clusterName);
  for (  DBRegionInfo region : dbClusterInfo.getDbRegions()) {
    List<DBInfo> slaveDBInfos=null;
    if (EnumDBMasterSlave.AUTO == masterSlave) {
      slaveDBInfos=region.getSlaveDBInfos().get(r.nextInt(region.getSlaveDBInfos().size() - 1));
    }
 else {
      slaveDBInfos=region.getSlaveDBInfos().get(masterSlave.getValue());
    }
    if (slaveDBInfos == null || slaveDBInfos.isEmpty()) {
      throw new DBClusterException("String_Node_Str" + clusterName);
    }
    for (    DBInfo dbInfo : slaveDBInfos) {
      for (int tableIndex=0; tableIndex < tableNum; tableIndex++) {
        dbResource=ShardingDBResource.valueOf(tx,dbInfo,region,tableName,tableIndex);
        dbResources.add(dbResource);
      }
    }
  }
  return dbResources;
}
Program: 90386
Project: 90386
Buggy source:
@Override public ShardingDBResource selectDBResourceFromMaster(String tableName,IShardingKey<?> value) throws DBClusterException {
  RouteInfo routeInfo=null;
  try {
    String clusterName=value.getClusterName();
    IClusterRouter router=this.dbRouterC.find(clusterName);
    if (router == null) {
      throw new IllegalStateException("String_Node_Str" + clusterName);
    }
    routeInfo=router.select(EnumDBMasterSlave.MASTER,tableName,value);
  }
 catch (  DBRouteException e) {
    throw new DBClusterException(e);
  }
  String clusterName=routeInfo.getClusterName();
  DBInfo dbInfo=routeInfo.getDbInfo();
  int tableIndex=routeInfo.getTableIndex();
  DBClusterInfo dbClusterInfo=this.dbClusterInfoC.find(clusterName);
  if (dbClusterInfo == null) {
    throw new DBClusterException("String_Node_Str" + value + "String_Node_Str"+ tableName);
  }
  DBRegionInfo regionInfo=dbClusterInfo.getDbRegions().get(routeInfo.getRegionIndex());
  if (regionInfo == null) {
    throw new DBClusterException("String_Node_Str" + value + "String_Node_Str"+ tableName);
  }
  ShardingDBResource db;
  try {
    db=ShardingDBResource.valueOf(dbInfo,regionInfo,tableName,tableIndex);
  }
 catch (  SQLException e) {
    throw new DBClusterException(e);
  }
  return db;
}

Fixed version (ground truth):
@Override public ShardingDBResource selectDBResourceFromMaster(String tableName,IShardingKey<?> value) throws DBClusterException {
  RouteInfo routeInfo=null;
  try {
    String clusterName=value.getClusterName();
    IClusterRouter router=this.dbRouterC.find(clusterName);
    if (router == null) {
      throw new IllegalStateException("String_Node_Str" + clusterName);
    }
    routeInfo=router.select(EnumDBMasterSlave.MASTER,tableName,value);
  }
 catch (  DBRouteException e) {
    throw new DBClusterException(e);
  }
  String clusterName=routeInfo.getClusterName();
  DBInfo dbInfo=routeInfo.getDbInfo();
  int tableIndex=routeInfo.getTableIndex();
  DBClusterInfo dbClusterInfo=this.dbClusterInfoC.find(clusterName);
  if (dbClusterInfo == null) {
    throw new DBClusterException("String_Node_Str" + value + "String_Node_Str"+ tableName);
  }
  DBRegionInfo regionInfo=dbClusterInfo.getDbRegions().get(routeInfo.getRegionIndex());
  if (regionInfo == null) {
    throw new DBClusterException("String_Node_Str" + value + "String_Node_Str"+ tableName);
  }
  ShardingDBResource db;
  try {
    ITransaction tx=(ITransaction)txManager.getTransaction();
    db=ShardingDBResource.valueOf(tx,dbInfo,regionInfo,tableName,tableIndex);
  }
 catch (  SQLException e) {
    throw new DBClusterException(e);
  }
catch (  SystemException e) {
    throw new DBOperationException(e);
  }
  return db;
}
Program: 90387
Project: 90387
Buggy source:
/** 
 * singleton
 * @param dbInfo
 * @return
 */
public static IDBResource valueOf(DBInfo dbInfo,String tableName) throws SQLException {
  IResourceId resId=new DBResourceId(dbInfo.getClusterName(),dbInfo.getDbName(),tableName,dbInfo.getMasterSlave());
  GlobalDBResource instance=(GlobalDBResource)DBResourceCache.getGlobalDBResource(resId);
  Connection conn=dbInfo.getDatasource().getConnection();
  conn.setAutoCommit(false);
  if (instance == null) {
    instance=new GlobalDBResource();
    instance.setId(resId);
    instance.setClusterName(dbInfo.getClusterName());
    instance.setDbName(dbInfo.getDbName());
    instance.setMasterSlave(dbInfo.getMasterSlave());
    DatabaseMetaData dbMeta=conn.getMetaData();
    String databaseProductName=dbMeta.getDatabaseProductName();
    String url=dbMeta.getURL().substring(13);
    String host=url.substring(0,url.indexOf("String_Node_Str"));
    String catalog=conn.getCatalog();
    instance.setDatabaseProductName(databaseProductName);
    instance.setHost(host);
    instance.setCatalog(catalog);
    DBResourceCache.putGlobalDBResource(resId,instance);
  }
  instance.setConnection(conn);
  return instance;
}

Fixed version (ground truth):
/** 
 * singleton
 * @param dbInfo
 * @return
 */
public static IDBResource valueOf(ITransaction tx,DBInfo dbInfo,String tableName) throws SQLException {
  IResourceId resId=new DBResourceId(dbInfo.getClusterName(),dbInfo.getDbName(),tableName,dbInfo.getMasterSlave());
  GlobalDBResource dbResource=null;
  if (tx != null && tx.isContain(resId)) {
    dbResource=(GlobalDBResource)tx.getDBResource(resId);
  }
 else {
    dbResource=(GlobalDBResource)DBResourceCache.getGlobalDBResource(resId);
    Connection conn=dbInfo.getDatasource().getConnection();
    conn.setAutoCommit(false);
    if (dbResource == null) {
      dbResource=new GlobalDBResource();
      dbResource.setId(resId);
      dbResource.setClusterName(dbInfo.getClusterName());
      dbResource.setDbName(dbInfo.getDbName());
      dbResource.setMasterSlave(dbInfo.getMasterSlave());
      DatabaseMetaData dbMeta=conn.getMetaData();
      String databaseProductName=dbMeta.getDatabaseProductName();
      String url=dbMeta.getURL().substring(13);
      String host=url.substring(0,url.indexOf("String_Node_Str"));
      String catalog=conn.getCatalog();
      dbResource.setDatabaseProductName(databaseProductName);
      dbResource.setHost(host);
      dbResource.setCatalog(catalog);
      DBResourceCache.putGlobalDBResource(resId,dbResource);
    }
    dbResource.setConnection(conn);
  }
  return dbResource;
}
Program: 90388
Project: 90388
Buggy source:
@Override public void closeDataSource(DBInfo dbInfo){
  dbConnectionPool.releaseDataSource(dbInfo.getDatasource());
}

Fixed version (ground truth):
@Override public void closeDataSource(DBInfo dbInfo){
  if (dbInfo instanceof AppDBInfo) {
    dbConnectionPool.releaseDataSource(dbInfo.getDatasource());
  }
 else   if (dbInfo instanceof EnvDBInfo) {
  }
}
Program: 90389
Project: 90389
Buggy source:
/** 
 * 构造方法.
 * @param enumDb 数据库类型
 */
public DBClusterImpl(EnumDB enumDb,IDBConnectionPool dbConnectionPool){
  super(enumDb);
  this.dbConnectionPool=dbConnectionPool;
}

Fixed version (ground truth):
/** 
 * 构造方法.
 * @param enumDb 数据库类型
 */
public DBClusterImpl(EnumDB enumDb,IDBConnectionPool dbConnectionPool){
  super(enumDb);
  this.dbConnectionPool=dbConnectionPool;
  try {
    this.initCtx=new InitialContext();
  }
 catch (  NamingException e) {
    throw new RuntimeException(e);
  }
}
Program: 90390
Project: 90390
Buggy source:
@Override public void buildDataSource(DBInfo dbConnInfo) throws LoadConfigException {
  AppDBInfo appDBInfo=(AppDBInfo)dbConnInfo;
  LOG.info(dbConnInfo.toString());
  DataSource ds=this.dbConnectionPool.buildDataSource(enumDb.getDriverClass(),appDBInfo.getUsername(),appDBInfo.getPassword(),appDBInfo.getUrl(),appDBInfo.getConnPoolInfo());
  dbConnInfo.setDatasource(ds);
}

Fixed version (ground truth):
@Override public void buildDataSource(DBInfo dbConnInfo) throws LoadConfigException {
  LOG.info(dbConnInfo.toString());
  DataSource ds=null;
  if (dbConnInfo instanceof AppDBInfo) {
    AppDBInfo appDBInfo=(AppDBInfo)dbConnInfo;
    ds=this.dbConnectionPool.buildDataSource(enumDb.getDriverClass(),appDBInfo.getUsername(),appDBInfo.getPassword(),appDBInfo.getUrl(),appDBInfo.getConnPoolInfo());
  }
 else   if (dbConnInfo instanceof EnvDBInfo) {
    EnvDBInfo envDbConnInfo=(EnvDBInfo)dbConnInfo;
    try {
      ds=(DataSource)this.initCtx.lookup(envDbConnInfo.getEnvDsName());
    }
 catch (    NamingException e) {
      throw new LoadConfigException("String_Node_Str" + envDbConnInfo.getEnvDsName());
    }
  }
 else {
    throw new LoadConfigException("String_Node_Str" + dbConnInfo.getClass());
  }
  dbConnInfo.setDatasource(ds);
}
Program: 90391
Project: 90391
Buggy source:
/** 
 * 读取分片缓存.
 * @param query 查询条件
 * @return 结果集.
 */
public List get(String whereSql,ShardingDBResource db);

Fixed version (ground truth):
/** 
 * 读取分片缓存.
 * @param query 查询条件
 * @return 结果集.
 */
public List get(String whereKey,ShardingDBResource db);
Program: 90392
Project: 90392
Buggy source:
/** 
 * 添加到全局缓存
 * @param query 查询条件
 * @param clusterName 集群名
 * @param clazz 对象class
 */
public void putGlobal(String whereSql,String clusterName,String tableName,List data);

Fixed version (ground truth):
/** 
 * 添加到全局缓存
 * @param query 查询条件
 * @param clusterName 集群名
 * @param clazz 对象class
 */
public void putGlobal(String whereKey,String clusterName,String tableName,List data);
Program: 90393
Project: 90393
Buggy source:
/** 
 * 读取全局缓存
 * @param query 查询条件
 * @param clusterName 集群名
 * @param clazz 对象class
 * @return 结果集
 */
public List getGlobal(String whereSql,String clusterName,String tableName);

Fixed version (ground truth):
/** 
 * 读取全局缓存
 * @param query 查询条件
 * @param clusterName 集群名
 * @param clazz 对象class
 * @return 结果集
 */
public List getGlobal(String whereKey,String clusterName,String tableName);
Program: 90394
Project: 90394
Buggy source:
/** 
 * 添加到分片缓存.
 * @param query 查询条件
 * @param data 结果集
 */
public void put(String whereSql,ShardingDBResource db,List data);

Fixed version (ground truth):
/** 
 * 添加到分片缓存.
 * @param query 查询条件
 * @param data 结果集
 */
public void put(String whereKey,ShardingDBResource db,List data);
Program: 90395
Project: 90395
Buggy source:
@Override public List get(String whereSql,ShardingDBResource db){
  if (StringUtil.isBlank(whereSql)) {
    return null;
  }
  try {
    String versionKey=_buildShardingVersion(db);
    if (_exists(versionKey)) {
      int version=Integer.parseInt((String)this.memClient.get(versionKey));
      String cacheKey=_buildShardingCacheKey(whereSql,db,version);
      List data=(List)this.memClient.get(cacheKey);
      if (LOG.isDebugEnabled() && data != null) {
        LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
      }
      return data;
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
@Override public List get(String whereKey,ShardingDBResource db){
  if (StringUtil.isBlank(whereKey)) {
    return null;
  }
  try {
    String versionKey=_buildShardingVersion(db);
    if (_exists(versionKey)) {
      int version=Integer.parseInt((String)this.memClient.get(versionKey));
      String cacheKey=_buildShardingCacheKey(whereKey,db,version);
      List data=(List)this.memClient.get(cacheKey);
      if (LOG.isDebugEnabled() && data != null) {
        LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
      }
      return data;
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
  return null;
}
Program: 90396
Project: 90396
Buggy source:
@Override public void putGlobal(String whereSql,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  try {
    String versionKey=_buildGlobalVersion(clusterName,tableName);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void putGlobal(String whereKey,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereKey) || data == null || data.isEmpty()) {
    return;
  }
  try {
    String versionKey=_buildGlobalVersion(clusterName,tableName);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildGlobalCacheKey(whereKey,clusterName,tableName,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}
Program: 90397
Project: 90397
Buggy source:
@Override public List getGlobal(String whereSql,String clusterName,String tableName){
  if (StringUtil.isBlank(whereSql)) {
    return null;
  }
  try {
    String versionKey=_buildGlobalVersion(clusterName,tableName);
    if (_exists(versionKey)) {
      int version=Integer.parseInt((String)this.memClient.get(versionKey));
      String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName,version);
      List data=(List)this.memClient.get(cacheKey);
      if (LOG.isDebugEnabled() && data != null) {
        LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
      }
      return data;
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
@Override public List getGlobal(String whereKey,String clusterName,String tableName){
  if (StringUtil.isBlank(whereKey)) {
    return null;
  }
  try {
    String versionKey=_buildGlobalVersion(clusterName,tableName);
    if (_exists(versionKey)) {
      int version=Integer.parseInt((String)this.memClient.get(versionKey));
      String cacheKey=_buildGlobalCacheKey(whereKey,clusterName,tableName,version);
      List data=(List)this.memClient.get(cacheKey);
      if (LOG.isDebugEnabled() && data != null) {
        LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
      }
      return data;
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
  return null;
}
Program: 90398
Project: 90398
Buggy source:
/** 
 * sharding second cache key. sec.[clustername].[startend].[tablename + tableIndex].[version].hashCode
 */
private String _buildShardingCacheKey(String whereSql,ShardingDBResource shardingDBResource,int version){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(shardingDBResource.getClusterName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getDbName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getRegionCapacity());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  cacheKey.append("String_Node_Str");
  cacheKey.append(version).append("String_Node_Str");
  cacheKey.append(SecurityUtil.md5(whereSql));
  return cacheKey.toString();
}

Fixed version (ground truth):
/** 
 * sharding second cache key. sec.[clustername].[startend].[tablename + tableIndex].[version].hashCode
 */
private String _buildShardingCacheKey(String whereKey,ShardingDBResource shardingDBResource,int version){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(shardingDBResource.getClusterName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getDbName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getRegionCapacity());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  cacheKey.append("String_Node_Str");
  cacheKey.append(version).append("String_Node_Str");
  cacheKey.append(SecurityUtil.md5(whereKey));
  return cacheKey.toString();
}
Program: 90399
Project: 90399
Buggy source:
/** 
 * global second cache key. sec.[clustername].[tablename].[version].hashCode
 */
private String _buildGlobalCacheKey(String whereSql,String clusterName,String tableName,int version){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(clusterName).append("String_Node_Str");
  cacheKey.append(tableName).append("String_Node_Str");
  cacheKey.append(version).append("String_Node_Str");
  cacheKey.append(SecurityUtil.md5(whereSql));
  return cacheKey.toString();
}

Fixed version (ground truth):
/** 
 * global second cache key. sec.[clustername].[tablename].[version].hashCode
 */
private String _buildGlobalCacheKey(String whereKey,String clusterName,String tableName,int version){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(clusterName).append("String_Node_Str");
  cacheKey.append(tableName).append("String_Node_Str");
  cacheKey.append(version).append("String_Node_Str");
  cacheKey.append(SecurityUtil.md5(whereKey));
  return cacheKey.toString();
}
Program: 90400
Project: 90400
Buggy source:
@Override public void put(String whereSql,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  try {
    String versionKey=_buildShardingVersion(db);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildShardingCacheKey(whereSql,db,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void put(String whereKey,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereKey) || data == null || data.isEmpty()) {
    return;
  }
  try {
    String versionKey=_buildShardingVersion(db);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildShardingCacheKey(whereKey,db,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}
Program: 90401
Project: 90401
Buggy source:
@Override public List get(String whereSql,ShardingDBResource db){
  if (StringUtil.isBlank(whereSql)) {
    return null;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildShardingCacheKey(whereSql,db);
    List data=IOUtil.getObject(redisClient.get(cacheKey.getBytes()),List.class);
    if (LOG.isDebugEnabled() && data != null) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
    return data;
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
  return null;
}

Fixed version (ground truth):
@Override public List get(String whereKey,ShardingDBResource db){
  if (StringUtil.isBlank(whereKey)) {
    return null;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildShardingCacheKey(whereKey,db);
    List data=IOUtil.getObject(redisClient.get(cacheKey.getBytes()),List.class);
    if (LOG.isDebugEnabled() && data != null) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
    return data;
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
  return null;
}
Program: 90402
Project: 90402
Buggy source:
@Override public void putGlobal(String whereSql,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}

Fixed version (ground truth):
@Override public void putGlobal(String whereKey,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereKey) || data == null || data.isEmpty()) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildGlobalCacheKey(whereKey,clusterName,tableName);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}
Program: 90403
Project: 90403
Buggy source:
@Override public List getGlobal(String whereSql,String clusterName,String tableName){
  if (StringUtil.isBlank(whereSql)) {
    return null;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName);
    List data=IOUtil.getObject(redisClient.get(cacheKey.getBytes()),List.class);
    if (LOG.isDebugEnabled() && data != null) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
    return data;
  }
 catch (  Exception e) {
    e.printStackTrace();
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
  return null;
}

Fixed version (ground truth):
@Override public List getGlobal(String whereKey,String clusterName,String tableName){
  if (StringUtil.isBlank(whereKey)) {
    return null;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildGlobalCacheKey(whereKey,clusterName,tableName);
    List data=IOUtil.getObject(redisClient.get(cacheKey.getBytes()),List.class);
    if (LOG.isDebugEnabled() && data != null) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
    return data;
  }
 catch (  Exception e) {
    e.printStackTrace();
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
  return null;
}
Program: 90404
Project: 90404
Buggy source:
/** 
 * sharding second cache key. sec.[clustername].[startend].[tablename + tableIndex].hashCode
 */
private String _buildShardingCacheKey(String whereSql,ShardingDBResource shardingDBResource){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(shardingDBResource.getClusterName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getDbName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getRegionCapacity());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  cacheKey.append("String_Node_Str");
  if (StringUtil.isNotBlank(whereSql))   cacheKey.append(SecurityUtil.md5(whereSql));
 else   cacheKey.append("String_Node_Str");
  return cacheKey.toString();
}

Fixed version (ground truth):
/** 
 * sharding second cache key. sec.[clustername].[startend].[tablename + tableIndex].hashCode
 */
private String _buildShardingCacheKey(String whereKey,ShardingDBResource shardingDBResource){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(shardingDBResource.getClusterName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getDbName());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getRegionCapacity());
  cacheKey.append("String_Node_Str");
  cacheKey.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  cacheKey.append("String_Node_Str");
  if (StringUtil.isNotBlank(whereKey))   cacheKey.append(SecurityUtil.md5(whereKey));
 else   cacheKey.append("String_Node_Str");
  return cacheKey.toString();
}
Program: 90405
Project: 90405
Buggy source:
/** 
 * global second cache key. sec.[clustername].[tablename].hashCode
 */
private String _buildGlobalCacheKey(String whereSql,String clusterName,String tableName){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(clusterName).append("String_Node_Str");
  cacheKey.append(tableName).append("String_Node_Str");
  if (StringUtil.isNotBlank(whereSql))   cacheKey.append(SecurityUtil.md5(whereSql));
 else   cacheKey.append("String_Node_Str");
  return cacheKey.toString();
}

Fixed version (ground truth):
/** 
 * global second cache key. sec.[clustername].[tablename].hashCode
 */
private String _buildGlobalCacheKey(String whereKey,String clusterName,String tableName){
  StringBuilder cacheKey=new StringBuilder("String_Node_Str");
  cacheKey.append(clusterName).append("String_Node_Str");
  cacheKey.append(tableName).append("String_Node_Str");
  if (StringUtil.isNotBlank(whereKey))   cacheKey.append(SecurityUtil.md5(whereKey));
 else   cacheKey.append("String_Node_Str");
  return cacheKey.toString();
}
Program: 90406
Project: 90406
Buggy source:
@Override public void put(String whereSql,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildShardingCacheKey(whereSql,db);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}

Fixed version (ground truth):
@Override public void put(String whereKey,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereKey) || data == null || data.isEmpty()) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildShardingCacheKey(whereKey,db);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}
Program: 90407
Project: 90407
Buggy source:
/** 
 * 获取实体的自增主键信息，如果没有则返回null;
 * @return
 */
public DBTablePK getNotUnionPrimaryKey(Class<?> clazz);

Fixed version (ground truth):
/** 
 * 获取实体的非联合主键信息，如果没有则返回null;
 * @return
 */
public DBTablePK getNotUnionPrimaryKey(Class<?> clazz);
Program: 90408
Project: 90408
Buggy source:
/** 
 * 获取联合主键的主键名
 * @param clazz
 * @return
 */
public PKName getNotUnionPkName(Class<?> clazz);

Fixed version (ground truth):
/** 
 * 获取非联合主键的主键名
 * @param clazz
 * @return
 */
public PKName getNotUnionPkName(Class<?> clazz);
Program: 90409
Project: 90409
Buggy source:
/** 
 * 将数据转换为数据对象
 * @param clazz 数据对象
 * @param rs 结果集
 * @return {pkValue, Object}
 * @throws SQLException
 */
public static <T>Map<EntityPK,T> createResultObjectAsMap(Class<T> clazz,ResultSet rs) throws SQLException {
  Map<EntityPK,T> map=Maps.newLinkedHashMap();
  ResultSetMetaData rsmd=rs.getMetaData();
  T one=null;
  String fieldName=null;
  PKName[] pkNames=entityMetaManager.getPkName(clazz);
  PKValue[] pkValues=null;
  Field f=null;
  Object value=null;
  while (rs.next()) {
    try {
      one=(T)clazz.newInstance();
      for (int i=1; i <= rsmd.getColumnCount(); i++) {
        fieldName=rsmd.getColumnName(i);
        f=BeansUtil.getField(clazz,fieldName);
        value=_getRsValue(rs,f,i);
        BeansUtil.setProperty(one,fieldName,value);
      }
      pkValues=new PKValue[pkNames.length];
      for (int i=0; i < pkNames.length; i++) {
        pkValues[i]=PKValue.valueOf(rs.getObject(pkNames[i].getValue()));
      }
      map.put(EntityPK.valueOf(pkNames,pkValues),one);
    }
 catch (    Exception e) {
      throw new SQLException(e);
    }
  }
  return map;
}

Fixed version (ground truth):
/** 
 * 将数据转换为数据对象
 * @param clazz 数据对象
 * @param rs 结果集
 * @return {pkValue, Object}
 * @throws SQLException
 */
public static <T>Map<EntityPK,T> createResultObjectAsMap(Class<T> clazz,ResultSet rs) throws SQLException {
  Map<EntityPK,T> map=Maps.newLinkedHashMap();
  ResultSetMetaData rsmd=rs.getMetaData();
  T one=null;
  String fieldName=null;
  PKName[] pkNames=entityMetaManager.getPkName(clazz);
  PKValue[] pkValues=null;
  Field f=null;
  Object value=null;
  while (rs.next()) {
    try {
      one=(T)clazz.newInstance();
      for (int i=1; i <= rsmd.getColumnCount(); i++) {
        fieldName=rsmd.getColumnName(i);
        f=BeansUtil.getField(clazz,fieldName);
        if (f == null) {
          continue;
        }
        value=_getRsValue(rs,f,i);
        BeansUtil.setProperty(one,fieldName,value);
      }
      pkValues=new PKValue[pkNames.length];
      for (int i=0; i < pkNames.length; i++) {
        pkValues[i]=PKValue.valueOf(rs.getObject(pkNames[i].getValue()));
      }
      map.put(EntityPK.valueOf(pkNames,pkValues),one);
    }
 catch (    Exception e) {
      throw new SQLException(e);
    }
  }
  return map;
}
Program: 90410
Project: 90410
Buggy source:
/** 
 * 给定数据库查询结果集创建数据对性.
 * @param clazz 数据对象class
 * @param rs 数据库查询结果集
 * @return 数据对象列表
 */
public static <T>List<T> createResultObject(Class<T> clazz,ResultSet rs) throws SQLException {
  List<T> list=new ArrayList<T>();
  ResultSetMetaData rsmd=rs.getMetaData();
  T one=null;
  while (rs.next()) {
    try {
      one=(T)clazz.newInstance();
      String fieldName=null;
      Field f=null;
      Object value=null;
      for (int i=1; i <= rsmd.getColumnCount(); i++) {
        fieldName=rsmd.getColumnName(i);
        f=BeansUtil.getField(clazz,fieldName);
        value=_getRsValue(rs,f,i);
        BeansUtil.setProperty(one,fieldName,value);
      }
      list.add(one);
    }
 catch (    Exception e) {
      throw new SQLException(e);
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * 给定数据库查询结果集创建数据对性.
 * @param clazz 数据对象class
 * @param rs 数据库查询结果集
 * @return 数据对象列表
 */
public static <T>List<T> createResultObject(Class<T> clazz,ResultSet rs) throws SQLException {
  List<T> list=new ArrayList<T>();
  ResultSetMetaData rsmd=rs.getMetaData();
  T one=null;
  while (rs.next()) {
    try {
      one=(T)clazz.newInstance();
      String fieldName=null;
      Field f=null;
      Object value=null;
      for (int i=1; i <= rsmd.getColumnCount(); i++) {
        fieldName=rsmd.getColumnName(i);
        f=BeansUtil.getField(clazz,fieldName);
        if (f == null) {
          continue;
        }
        value=_getRsValue(rs,f,i);
        BeansUtil.setProperty(one,fieldName,value);
      }
      list.add(one);
    }
 catch (    Exception e) {
      throw new SQLException(e);
    }
  }
  return list;
}
Program: 90411
Project: 90411
Buggy source:
/** 
 * 获取多条记录.
 * @param db 分库分表
 * @param ids 主键
 * @return 多条数据
 */
public <T>List<T> get(ShardingDBResource db,EntityPK[] ids);

Fixed version (ground truth):
/** 
 * 获取多条记录.
 * @param db 分库分表
 * @param ids 主键
 * @return 多条数据
 */
public <T>Map<EntityPK,T> get(ShardingDBResource db,EntityPK[] ids);
Program: 90412
Project: 90412
Buggy source:
/** 
 * 获取多条记录.
 * @param db 分库分表
 * @param pks 主键
 * @return 多条数据
 */
public <T>List<T> getGlobal(String clusterName,String tableName,EntityPK[] pks);

Fixed version (ground truth):
/** 
 * 获取多条记录.
 * @param db 分库分表
 * @param pks 主键
 * @return 多条数据
 */
public <T>Map<EntityPK,T> getGlobal(String clusterName,String tableName,EntityPK[] pks);
Program: 90413
Project: 90413
Buggy source:
/** 
 * build sharding count key [clusterName + dbIndex].[start + end].[tableName + tableIndex].c
 */
protected String buildCountKey(ShardingDBResource shardingDBResource){
  StringBuilder key=new StringBuilder();
  key.append(shardingDBResource.getClusterName()).append(shardingDBResource.getDbName());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getRegionCapacity());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  key.append("String_Node_Str");
  return key.toString();
}

Fixed version (ground truth):
/** 
 * build sharding count key [clusterName + dbIndex].[start + end].[tableName + tableIndex].c
 */
protected String buildCountKey(ShardingDBResource shardingDBResource){
  StringBuilder key=new StringBuilder();
  key.append(shardingDBResource.getClusterName());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getDbName());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getRegionCapacity());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  key.append("String_Node_Str");
  return key.toString();
}
Program: 90414
Project: 90414
Buggy source:
/** 
 * build sharding cache key [clusterName + dbIndex].[start + end].[tableName + tableIndex].[id]
 */
protected String buildKey(ShardingDBResource shardingDBResource,EntityPK entityPk){
  StringBuilder key=new StringBuilder();
  key.append(shardingDBResource.getClusterName()).append(shardingDBResource.getDbName());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getRegionCapacity());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  key.append("String_Node_Str");
  StringBuilder pks=new StringBuilder();
  for (  PKValue pkValue : entityPk.getPkValues()) {
    pks.append(pkValue.getValueAsString());
  }
  key.append(pks.toString());
  return key.toString();
}

Fixed version (ground truth):
/** 
 * build sharding cache key [clusterName + dbIndex].[start + end].[tableName + tableIndex].[id]
 */
protected String buildKey(ShardingDBResource shardingDBResource,EntityPK entityPk){
  StringBuilder key=new StringBuilder();
  key.append(shardingDBResource.getClusterName());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getDbName());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getRegionCapacity());
  key.append("String_Node_Str");
  key.append(shardingDBResource.getTableName()).append(shardingDBResource.getTableIndex());
  if (entityPk != null) {
    key.append("String_Node_Str");
    StringBuilder pks=new StringBuilder();
    for (    PKValue pkValue : entityPk.getPkValues()) {
      pks.append(pkValue.getValueAsString());
    }
    key.append(pks.toString());
  }
  return key.toString();
}
Program: 90415
Project: 90415
Buggy source:
/** 
 * build global cache key [clusterName].[tableName].[id]
 */
protected String buildGlobalKey(String clusterName,String tableName,EntityPK entityPk){
  StringBuilder key=new StringBuilder();
  key.append(clusterName).append("String_Node_Str").append(tableName).append("String_Node_Str");
  StringBuilder pks=new StringBuilder();
  for (  PKValue pkValue : entityPk.getPkValues()) {
    pks.append(pkValue.getValueAsString());
  }
  key.append(pks.toString());
  return key.toString();
}

Fixed version (ground truth):
/** 
 * build global cache key [clusterName].[tableName].[id]
 */
protected String buildGlobalKey(String clusterName,String tableName,EntityPK entityPk){
  StringBuilder key=new StringBuilder();
  key.append(clusterName).append("String_Node_Str").append(tableName);
  if (entityPk != null) {
    key.append("String_Node_Str");
    StringBuilder pks=new StringBuilder();
    for (    PKValue pkValue : entityPk.getPkValues()) {
      pks.append(pkValue.getValueAsString());
    }
    key.append(pks.toString());
  }
  return key.toString();
}
Program: 90416
Project: 90416
Buggy source:
private void _put(List<String> keys,List<? extends Object> data){
  try {
    for (int i=0; i < keys.size(); i++) {
      memClient.set(keys.get(i),expire,data.get(i));
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + e.getMessage());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + keys.size() + "String_Node_Str"+ keys);
  }
}

Fixed version (ground truth):
private void _put(List<String> keys,List<? extends Object> data){
  if (data == null || data.isEmpty()) {
    return;
  }
  try {
    for (int i=0; i < keys.size(); i++) {
      memClient.set(keys.get(i),expire,data.get(i));
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + e.getMessage());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + keys.size() + "String_Node_Str"+ keys);
  }
}
Program: 90417
Project: 90417
Buggy source:
@Override public void putGlobal(String whereSql,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereSql)) {
    return;
  }
  try {
    String versionKey=_buildGlobalVersion(clusterName,tableName);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void putGlobal(String whereSql,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  try {
    String versionKey=_buildGlobalVersion(clusterName,tableName);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}
Program: 90418
Project: 90418
Buggy source:
@Override public void put(String whereSql,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereSql)) {
    return;
  }
  try {
    String versionKey=_buildShardingVersion(db);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildShardingCacheKey(whereSql,db,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void put(String whereSql,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  try {
    String versionKey=_buildShardingVersion(db);
    int version=r.nextInt(10000);
    if (!_exists(versionKey)) {
      this.memClient.incr(versionKey,0,version);
    }
 else {
      version=Integer.parseInt((String)this.memClient.get(versionKey));
    }
    String cacheKey=_buildShardingCacheKey(whereSql,db,version);
    this.memClient.set(cacheKey,expire,data);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
}
Program: 90419
Project: 90419
Buggy source:
private void _put(List<String> keys,List<? extends Object> data){
  try {
    for (int i=0; i < keys.size(); i++) {
      _put(keys.get(i),data.get(i));
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + e.getMessage());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + keys.size() + "String_Node_Str"+ keys);
  }
}

Fixed version (ground truth):
private void _put(List<String> keys,List<? extends Object> data){
  if (data == null || data.isEmpty()) {
    return;
  }
  try {
    for (int i=0; i < keys.size(); i++) {
      _put(keys.get(i),data.get(i));
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + e.getMessage());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + keys.size() + "String_Node_Str"+ keys);
  }
}
Program: 90420
Project: 90420
Buggy source:
@Override public void removeGlobal(String clusterName,String tableName){
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    List<String> keys=new ArrayList<String>();
    Collection<Jedis> shards=redisClient.getAllShards();
    String cacheKey=_buildGlobalCacheKey(null,clusterName,tableName);
    for (    Jedis shard : shards) {
      keys.addAll(shard.keys(cacheKey));
      shard.del(keys.toArray(new String[0]));
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}

Fixed version (ground truth):
@Override public void removeGlobal(String clusterName,String tableName){
  ShardedJedis redisClient=null;
  String cacheKey=_buildGlobalCacheKey(null,clusterName,tableName);
  try {
    redisClient=jedisPool.getResource();
    Collection<Jedis> shards=redisClient.getAllShards();
    Set<String> keys=null;
    for (    Jedis shard : shards) {
      keys=shard.keys(cacheKey);
      if (keys != null && !keys.isEmpty())       shard.del(keys.toArray(new String[keys.size()]));
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}
Program: 90421
Project: 90421
Buggy source:
@Override public void putGlobal(String whereSql,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereSql)) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}

Fixed version (ground truth):
@Override public void putGlobal(String whereSql,String clusterName,String tableName,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildGlobalCacheKey(whereSql,clusterName,tableName);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}
Program: 90422
Project: 90422
Buggy source:
@Override public void put(String whereSql,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereSql)) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildShardingCacheKey(whereSql,db);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}

Fixed version (ground truth):
@Override public void put(String whereSql,ShardingDBResource db,List data){
  if (StringUtil.isBlank(whereSql) || data == null || data.isEmpty()) {
    return;
  }
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    String cacheKey=_buildShardingCacheKey(whereSql,db);
    redisClient.set(cacheKey.getBytes(),IOUtil.getBytes(data));
    redisClient.expire(cacheKey.getBytes(),expire);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}
Program: 90423
Project: 90423
Buggy source:
@Override public void remove(ShardingDBResource db){
  ShardedJedis redisClient=null;
  try {
    redisClient=jedisPool.getResource();
    List<String> keys=new ArrayList<String>();
    Collection<Jedis> shards=redisClient.getAllShards();
    String cacheKey=_buildShardingCacheKey(null,db);
    for (    Jedis shard : shards) {
      keys.addAll(shard.keys(cacheKey));
      shard.del(keys.toArray(new String[0]));
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str");
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}

Fixed version (ground truth):
@Override public void remove(ShardingDBResource db){
  ShardedJedis redisClient=null;
  String cacheKey=_buildShardingCacheKey(null,db);
  try {
    redisClient=jedisPool.getResource();
    Collection<Jedis> shards=redisClient.getAllShards();
    Set<String> keys=null;
    for (    Jedis shard : shards) {
      keys=shard.keys(cacheKey);
      if (keys != null && !keys.isEmpty())       shard.del(keys.toArray(new String[keys.size()]));
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + cacheKey + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + cacheKey);
  }
 finally {
    if (redisClient != null)     redisClient.close();
  }
}