nus-yam/ex-repair huggingface dataset:
Program: 90475
Project: 90475
Buggy source:
public static TestGlobalEntity createGlobalEntity(){
  TestGlobalEntity testEntity=new TestGlobalEntity();
  testEntity.setTestBool(r.nextBoolean());
  testEntity.setoTestBool(r.nextBoolean());
  testEntity.setTestByte((byte)255);
  testEntity.setoTestByte((byte)255);
  testEntity.setTestChar('b');
  testEntity.setoTestChar('b');
  testEntity.setTestDate(new Date());
  testEntity.setTestDouble(1.0);
  testEntity.setoTestDouble(1.0);
  testEntity.setTestFloat(2.0f);
  testEntity.setoTestFloat(2.0f);
  testEntity.setTestInt(5);
  testEntity.setoTestInt(5);
  testEntity.setTestLong(6l);
  testEntity.setoTestLong(6l);
  testEntity.setTestShort((short)7);
  testEntity.setoTestShort((short)7);
  testEntity.setTestString(getContent(r.nextInt(100)));
  testEntity.setTestTime(new Timestamp(System.currentTimeMillis()));
  return testEntity;
}

Fixed version (ground truth):
public static TestGlobalEntity createGlobalEntity(){
  TestGlobalEntity testEntity=new TestGlobalEntity();
  testEntity.setTestBool(true);
  testEntity.setoTestBool(false);
  testEntity.setTestByte((byte)255);
  testEntity.setoTestByte((byte)255);
  testEntity.setTestChar('b');
  testEntity.setoTestChar('b');
  testEntity.setTestDate(new Date());
  testEntity.setTestDouble(1.0);
  testEntity.setoTestDouble(1.0);
  testEntity.setTestFloat(2.0f);
  testEntity.setoTestFloat(2.0f);
  testEntity.setTestInt(5);
  testEntity.setoTestInt(5);
  testEntity.setTestLong(6l);
  testEntity.setoTestLong(6l);
  testEntity.setTestShort((short)7);
  testEntity.setoTestShort((short)7);
  testEntity.setTestString(getContent(r.nextInt(100)));
  testEntity.setTestTime(new Timestamp(System.currentTimeMillis()));
  return testEntity;
}
Program: 90476
Project: 90476
Buggy source:
public static TestGlobalUnionKeyEntity createGlobalUnionKeyEntity(){
  TestGlobalUnionKeyEntity testEntity=new TestGlobalUnionKeyEntity();
  testEntity.setTestBool(r.nextBoolean());
  testEntity.setoTestBool(r.nextBoolean());
  testEntity.setTestByte((byte)255);
  testEntity.setoTestByte((byte)255);
  testEntity.setTestChar('b');
  testEntity.setoTestChar('b');
  testEntity.setTestDate(new Date());
  testEntity.setTestDouble(1.0);
  testEntity.setoTestDouble(1.0);
  testEntity.setTestFloat(2.0f);
  testEntity.setoTestFloat(2.0f);
  testEntity.setTestInt(5);
  testEntity.setoTestInt(5);
  testEntity.setTestLong(6l);
  testEntity.setoTestLong(6l);
  testEntity.setTestShort((short)7);
  testEntity.setoTestShort((short)7);
  testEntity.setTestString(getContent(r.nextInt(100)));
  testEntity.setTestTime(new Timestamp(System.currentTimeMillis()));
  return testEntity;
}

Fixed version (ground truth):
public static TestGlobalUnionKeyEntity createGlobalUnionKeyEntity(){
  TestGlobalUnionKeyEntity testEntity=new TestGlobalUnionKeyEntity();
  testEntity.setTestBool(true);
  testEntity.setoTestBool(false);
  testEntity.setTestByte((byte)255);
  testEntity.setoTestByte((byte)255);
  testEntity.setTestChar('b');
  testEntity.setoTestChar('b');
  testEntity.setTestDate(new Date());
  testEntity.setTestDouble(1.0);
  testEntity.setoTestDouble(1.0);
  testEntity.setTestFloat(2.0f);
  testEntity.setoTestFloat(2.0f);
  testEntity.setTestInt(5);
  testEntity.setoTestInt(5);
  testEntity.setTestLong(6l);
  testEntity.setoTestLong(6l);
  testEntity.setTestShort((short)7);
  testEntity.setoTestShort((short)7);
  testEntity.setTestString(getContent(r.nextInt(100)));
  testEntity.setTestTime(new Timestamp(System.currentTimeMillis()));
  return testEntity;
}
Program: 90477
Project: 90477
Buggy source:
public static TestEntity createEntity(){
  TestEntity testEntity=new TestEntity();
  testEntity.setTestBool(r.nextBoolean());
  testEntity.setOTestBool(r.nextBoolean());
  testEntity.setTestByte((byte)255);
  testEntity.setOTestByte((byte)255);
  testEntity.setTestChar('a');
  testEntity.setOTestChar('a');
  testEntity.setTestDate(new Date());
  testEntity.setTestDouble(1.0);
  testEntity.setOTestDouble(1.0);
  testEntity.setTestFloat(2.0f);
  testEntity.setOTestFloat(2.0f);
  testEntity.setTestInt(5);
  testEntity.setOTestInt(5);
  testEntity.setTestLong(6l);
  testEntity.setOTestLong(6l);
  testEntity.setTestShort((short)7);
  testEntity.setOTestShort((short)7);
  testEntity.setTestString(getContent(r.nextInt(100)));
  testEntity.setTestTime(new Timestamp(System.currentTimeMillis()));
  return testEntity;
}

Fixed version (ground truth):
public static TestEntity createEntity(){
  TestEntity testEntity=new TestEntity();
  testEntity.setTestBool(true);
  testEntity.setOTestBool(false);
  testEntity.setTestByte((byte)255);
  testEntity.setOTestByte((byte)255);
  testEntity.setTestChar('a');
  testEntity.setOTestChar('a');
  testEntity.setTestDate(new Date());
  testEntity.setTestDouble(1.0);
  testEntity.setOTestDouble(1.0);
  testEntity.setTestFloat(2.0f);
  testEntity.setOTestFloat(2.0f);
  testEntity.setTestInt(5);
  testEntity.setOTestInt(5);
  testEntity.setTestLong(6l);
  testEntity.setOTestLong(6l);
  testEntity.setTestShort((short)7);
  testEntity.setOTestShort((short)7);
  testEntity.setTestString(getContent(r.nextInt(100)));
  testEntity.setTestTime(new Timestamp(System.currentTimeMillis()));
  return testEntity;
}
Program: 90478
Project: 90478
Buggy source:
public long getId(){
  return id;
}

Fixed version (ground truth):
public Integer getId(){
  return id;
}
Program: 90479
Project: 90479
Buggy source:
public void setId(long id){
  this.id=id;
}

Fixed version (ground truth):
public void setId(Integer id){
  this.id=id;
}
Program: 90480
Project: 90480
Buggy source:
@Transactional public void saveDataWithException(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
  throw new RuntimeException();
}

Fixed version (ground truth):
@Transactional public void saveDataWithException(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId((int)globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
  throw new RuntimeException();
}
Program: 90481
Project: 90481
Buggy source:
@Transactional public void saveData(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
}

Fixed version (ground truth):
@Transactional public void saveData(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId((int)globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
}
Program: 90482
Project: 90482
Buggy source:
@Test public void testRollback(){
  long globalId=1;
  long shardingId=1;
  TestGlobalEntity testGlobalEntity=createGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=createEntity();
  testEntity.setId(shardingId);
  storageClient.beginTransaction();
  try {
    storageClient.globalSave(testGlobalEntity).longValue();
    storageClient.save(testEntity).longValue();
    throw new RuntimeException();
  }
 catch (  Exception e) {
    storageClient.rollback();
  }
  TestGlobalEntity a=storageClient.findByPk(globalId,TestGlobalEntity.class);
  IShardingKey<Integer> sk=new ShardingKey<Integer>(CLUSTER_KLSTORAGE,testEntity.getTestInt());
  TestEntity b=storageClient.findByPk(shardingId,sk,TestEntity.class);
  Assert.assertNull(a);
  Assert.assertNull(b);
}

Fixed version (ground truth):
@Test public void testRollback(){
  int globalId=1;
  long shardingId=1;
  TestGlobalEntity testGlobalEntity=createGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=createEntity();
  testEntity.setId(shardingId);
  storageClient.beginTransaction();
  try {
    storageClient.globalSave(testGlobalEntity).longValue();
    storageClient.save(testEntity).longValue();
    throw new RuntimeException();
  }
 catch (  Exception e) {
    storageClient.rollback();
  }
  TestGlobalEntity a=storageClient.findByPk(globalId,TestGlobalEntity.class);
  IShardingKey<Integer> sk=new ShardingKey<Integer>(CLUSTER_KLSTORAGE,testEntity.getTestInt());
  TestEntity b=storageClient.findByPk(shardingId,sk,TestEntity.class);
  Assert.assertNull(a);
  Assert.assertNull(b);
}
Program: 90483
Project: 90483
Buggy source:
/** 
 * 通过反射给对象属性赋值.
 * @param obj 被反射的对象
 * @param propertyName 赋值的属性名
 * @param value 值
 * @throws Exception 操作失败
 */
public static void setProperty(Object obj,String propertyName,Object value) throws Exception {
  Field f=getField(obj.getClass(),propertyName);
  if (f == null) {
    f=obj.getClass().getDeclaredField(propertyName);
  }
  f.setAccessible(true);
  if (f.getType() == Boolean.TYPE || f.getType() == Boolean.class) {
    f.setBoolean(obj,((Boolean)value).booleanValue());
  }
 else   if (f.getType() == Integer.TYPE || f.getType() == Integer.class) {
    f.setInt(obj,((Number)value).intValue());
  }
 else   if (f.getType() == Byte.TYPE || f.getType() == Byte.class) {
    f.setByte(obj,((Number)value).byteValue());
  }
 else   if (f.getType() == Long.TYPE || f.getType() == Long.class) {
    f.setLong(obj,((Number)value).longValue());
  }
 else   if (f.getType() == Short.TYPE || f.getType() == Short.class) {
    f.setShort(obj,((Number)value).shortValue());
  }
 else   if (f.getType() == Float.TYPE || f.getType() == Short.class) {
    f.setFloat(obj,((Number)value).floatValue());
  }
 else   if (f.getType() == Double.TYPE || f.getType() == Double.class) {
    f.setDouble(obj,((Number)value).doubleValue());
  }
 else {
    f.set(obj,value);
  }
}

Fixed version (ground truth):
/** 
 * 通过反射给对象属性赋值.
 * @param obj 被反射的对象
 * @param propertyName 赋值的属性名
 * @param value 值
 * @throws Exception 操作失败
 */
public static void setProperty(Object obj,String propertyName,Object value) throws Exception {
  Field f=getField(obj.getClass(),propertyName);
  if (f == null) {
    f=obj.getClass().getDeclaredField(propertyName);
  }
  f.setAccessible(true);
  if (f.getType() == Boolean.TYPE) {
    f.setBoolean(obj,((Boolean)value).booleanValue());
  }
 else   if (f.getType() == Integer.TYPE) {
    f.setInt(obj,((Number)value).intValue());
  }
 else   if (f.getType() == Byte.TYPE) {
    f.setByte(obj,((Number)value).byteValue());
  }
 else   if (f.getType() == Long.TYPE) {
    f.setLong(obj,((Number)value).longValue());
  }
 else   if (f.getType() == Short.TYPE) {
    f.setShort(obj,((Number)value).shortValue());
  }
 else   if (f.getType() == Float.TYPE) {
    f.setFloat(obj,((Number)value).floatValue());
  }
 else   if (f.getType() == Double.TYPE) {
    f.setDouble(obj,((Number)value).doubleValue());
  }
 else   if (f.getType() == Character.TYPE) {
    f.setChar(obj,((Character)value).charValue());
  }
 else {
    f.set(obj,value);
  }
}
Program: 90484
Project: 90484
Buggy source:
@Test public void testSetProperty() throws Exception {
  TestEntity entity=new TestEntity();
  ReflectUtil.setProperty(entity,"String_Node_Str","String_Node_Str");
  Assert.assertEquals("String_Node_Str",entity.getTestString());
}

Fixed version (ground truth):
@Test public void testSetProperty() throws Exception {
  TestEntity entity=new TestEntity();
  ReflectUtil.setProperty(entity,"String_Node_Str","String_Node_Str");
  Assert.assertEquals("String_Node_Str",entity.getTestString());
  ReflectUtil.setProperty(entity,"String_Node_Str",1);
  Assert.assertEquals(1,entity.getOTestInt().intValue());
}
Program: 90485
Project: 90485
Buggy source:
@Override public void load(Object entity,boolean useCache,EnumDBMasterSlave masterSlave){
  if (entity == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Object loadedEntity=null;
  EntityPK entityPk=entityMetaManager.getEntityPK(entity);
  Class<?> clazz=entity.getClass();
  if (entityMetaManager.isShardingEntity(clazz)) {
    loadedEntity=this.shardingQuery.findByPk(entityPk,clazz,useCache,masterSlave);
  }
 else {
    loadedEntity=this.globalQuery.findByPk(entityPk,clazz,useCache,masterSlave);
  }
  if (loadedEntity == null) {
    throw new DBOperationException("String_Node_Str" + entityPk);
  }
  try {
    BeansUtil.copyProperties(loadedEntity,entity);
  }
 catch (  Exception e) {
    throw new DBOperationException(e);
  }
}

Fixed version (ground truth):
@Override public void load(Object entity,boolean useCache,EnumDBMasterSlave masterSlave){
  if (entity == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Object loadedEntity=null;
  EntityPK entityPk=entityMetaManager.getEntityPK(entity);
  Class<?> clazz=entity.getClass();
  if (entityMetaManager.isShardingEntity(clazz)) {
    loadedEntity=this.shardingQuery.findByPkList(Lists.newArrayList(entityPk),clazz,useCache,masterSlave);
  }
 else {
    loadedEntity=this.globalQuery.findByPkList(Lists.newArrayList(entityPk),clazz,useCache,masterSlave);
  }
  if (loadedEntity == null) {
    throw new DBOperationException("String_Node_Str" + entityPk);
  }
  try {
    BeansUtil.copyProperties(loadedEntity,entity);
  }
 catch (  Exception e) {
    throw new DBOperationException(e);
  }
}
Program: 90487
Project: 90487
Buggy source:
/** 
 * 将数据转换为数据对象
 * @param clazz 数据对象
 * @param rs 结果集
 * @return {pkValue, Object}
 * @throws SQLException
 */
public static <T>Map<EntityPK,T> buildResultObjectAsMap(Class<T> clazz,ResultSet rs) throws SQLException {
  Map<EntityPK,T> map=Maps.newHashMap();
  ResultSetMetaData rsmd=rs.getMetaData();
  T one=null;
  String fieldName=null;
  PKName[] pkNames=entityMetaManager.getPkName(clazz);
  PKValue[] pkValues=new PKValue[pkNames.length];
  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);
      }
      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> buildResultObjectAsMap(Class<T> clazz,ResultSet rs) throws SQLException {
  Map<EntityPK,T> map=Maps.newHashMap();
  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;
}
Program: 90488
Project: 90488
Buggy source:
public Integer getId(){
  return id;
}

Fixed version (ground truth):
public long getId(){
  return id;
}
Program: 90489
Project: 90489
Buggy source:
public void setId(Integer id){
  this.id=id;
}

Fixed version (ground truth):
public void setId(long id){
  this.id=id;
}
Program: 90490
Project: 90490
Buggy source:
@Transactional public void saveDataWithException(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId((int)globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
  throw new RuntimeException();
}

Fixed version (ground truth):
@Transactional public void saveDataWithException(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
  throw new RuntimeException();
}
Program: 90491
Project: 90491
Buggy source:
@Transactional public void saveData(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId((int)globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
}

Fixed version (ground truth):
@Transactional public void saveData(long globalId,long shardingId){
  TestGlobalEntity testGlobalEntity=new TestGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=new TestEntity();
  testEntity.setId(shardingId);
  testEntity.setTestInt(10);
  storageClient.globalSave(testGlobalEntity);
  storageClient.save(testEntity);
}
Program: 90492
Project: 90492
Buggy source:
@Test public void testRollback(){
  int globalId=1;
  long shardingId=1;
  TestGlobalEntity testGlobalEntity=createGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=createEntity();
  testEntity.setId(shardingId);
  storageClient.beginTransaction();
  try {
    storageClient.globalSave(testGlobalEntity).longValue();
    storageClient.save(testEntity).longValue();
    throw new RuntimeException();
  }
 catch (  Exception e) {
    storageClient.rollback();
  }
  TestGlobalEntity a=storageClient.findByPk(globalId,TestGlobalEntity.class);
  IShardingKey<Integer> sk=new ShardingKey<Integer>(CLUSTER_KLSTORAGE,testEntity.getTestInt());
  TestEntity b=storageClient.findByPk(shardingId,sk,TestEntity.class);
  Assert.assertNull(a);
  Assert.assertNull(b);
}

Fixed version (ground truth):
@Test public void testRollback(){
  long globalId=1;
  long shardingId=1;
  TestGlobalEntity testGlobalEntity=createGlobalEntity();
  testGlobalEntity.setId(globalId);
  TestEntity testEntity=createEntity();
  testEntity.setId(shardingId);
  storageClient.beginTransaction();
  try {
    storageClient.globalSave(testGlobalEntity).longValue();
    storageClient.save(testEntity).longValue();
    throw new RuntimeException();
  }
 catch (  Exception e) {
    storageClient.rollback();
  }
  TestGlobalEntity a=storageClient.findByPk(globalId,TestGlobalEntity.class);
  IShardingKey<Integer> sk=new ShardingKey<Integer>(CLUSTER_KLSTORAGE,testEntity.getTestInt());
  TestEntity b=storageClient.findByPk(shardingId,sk,TestEntity.class);
  Assert.assertNull(a);
  Assert.assertNull(b);
}
Program: 90494
Project: 90494
Buggy source:
/** 
 * 初始化方法
 */
public void init() throws LoadConfigException {
  IClusterConfig clusterConfig=XmlClusterConfigImpl.getInstance();
  EnumDbConnectionPoolCatalog enumDbCpCatalog=clusterConfig.getDbConnectionPoolCatalog();
switch (enumDbCpCatalog) {
case APP:
    this.dbCluster=new AppDBClusterImpl(enumDb);
  break;
case ENV:
this.dbCluster=new EnvDBClusterImpl(enumDb);
break;
default :
this.dbCluster=new AppDBClusterImpl(enumDb);
break;
}
this.dbCluster.setDbRouteAlg(this.enumDBRouteAlg);
this.dbCluster.setSyncAction(syncAction);
this.dbCluster.setScanPackage(this.scanPackage);
try {
this.dbCluster.startup();
}
 catch (DBClusterException e) {
throw new RuntimeException(e);
}
IDataLayerBuilder dataLayerBuilder=this.dbCluster.getDataLayerBuilder();
this.globalUpdater=dataLayerBuilder.buildGlobalUpdate(this.dbCluster.getIdGenerator());
this.globalMasterQuery=dataLayerBuilder.buildGlobalMasterQuery();
this.globalSlaveQuery=dataLayerBuilder.buildGlobalSlaveQuery();
this.shardingUpdater=dataLayerBuilder.buildShardingUpdate(this.dbCluster.getIdGenerator());
this.masterQueryer=new ShardingJdbcMasterQueryImpl();
this.slaveQueryer=new ShardingJdbcSlaveQueryImpl();
instance=this;
}

Fixed version (ground truth):
/** 
 * 初始化方法
 */
public void init() throws LoadConfigException {
  IClusterConfig clusterConfig=XmlClusterConfigImpl.getInstance();
  EnumDbConnectionPoolCatalog enumDbCpCatalog=clusterConfig.getDbConnectionPoolCatalog();
switch (enumDbCpCatalog) {
case APP:
    this.dbCluster=new AppDBClusterImpl(enumDb);
  break;
case ENV:
this.dbCluster=new EnvDBClusterImpl(enumDb);
break;
default :
this.dbCluster=new AppDBClusterImpl(enumDb);
break;
}
this.dbCluster.setDbRouteAlg(this.enumDBRouteAlg);
this.dbCluster.setSyncAction(syncAction);
this.dbCluster.setScanPackage(this.scanPackage);
try {
this.dbCluster.startup();
}
 catch (DBClusterException e) {
throw new RuntimeException(e);
}
this.idGenerator=this.dbCluster.getIdGenerator();
IDataLayerBuilder dataLayerBuilder=this.dbCluster.getDataLayerBuilder();
this.globalUpdater=dataLayerBuilder.buildGlobalUpdate(this.dbCluster.getIdGenerator());
this.globalMasterQuery=dataLayerBuilder.buildGlobalMasterQuery();
this.globalSlaveQuery=dataLayerBuilder.buildGlobalSlaveQuery();
this.shardingUpdater=dataLayerBuilder.buildShardingUpdate(this.dbCluster.getIdGenerator());
this.masterQueryer=dataLayerBuilder.buildShardingMasterQuery();
this.slaveQueryer=dataLayerBuilder.buildShardingSlaveQuery();
instance=this;
}
Program: 90497
Project: 90497
Buggy source:
/** 
 * 初始化分表. 并将分表信息设置到分库分表路由器, 主库和从库的分表信息是相同的，因此使用主库集群进行设置.
 * @throws DBClusterException 初始化失败
 */
private void _initTableCluster(Map<String,DBClusterInfo> dbCluster,List<DBTable> tables) throws DBClusterException {
  Map<Integer,Map<String,Integer>> oneDbTable=null;
  Map<String,Integer> tableNum=null;
  for (  Map.Entry<String,DBClusterInfo> entry : dbClusterInfo.entrySet()) {
    oneDbTable=new HashMap<Integer,Map<String,Integer>>();
    String clusterName=entry.getKey();
    int dbNum=0;
    List<DBClusterRegionInfo> regions=entry.getValue().getDbRegions();
    if (!regions.isEmpty())     dbNum=regions.get(0).getMasterConnection().size();
    for (int i=0; i < dbNum; i++) {
      tableNum=_loadTableCluster(clusterName,tables);
      oneDbTable.put(i,tableNum);
    }
    tableCluster.put(clusterName,oneDbTable);
  }
  this.dbRouter.setTableCluster(tableCluster);
}

Fixed version (ground truth):
/** 
 * 初始化分表. 并将分表信息设置到分库分表路由器, 主库和从库的分表信息是相同的，因此使用主库集群进行设置.
 * @throws DBClusterException 初始化失败
 */
private void _initTableCluster(Map<String,DBClusterInfo> dbCluster,List<DBTable> tables) throws DBClusterException {
  Map<Integer,Map<String,Integer>> oneDbTable=null;
  Map<String,Integer> tableNum=null;
  for (  Map.Entry<String,DBClusterInfo> entry : dbClusterInfo.entrySet()) {
    oneDbTable=new HashMap<Integer,Map<String,Integer>>();
    String clusterName=entry.getKey();
    int dbNum=0;
    List<DBClusterRegionInfo> regions=entry.getValue().getDbRegions();
    if (!regions.isEmpty())     dbNum=regions.get(0).getMasterConnection().size();
    for (int i=0; i < dbNum; i++) {
      tableNum=_loadTableCluster(clusterName,tables);
      oneDbTable.put(i,tableNum);
    }
    tableCluster.put(clusterName,oneDbTable);
  }
}
Program: 90498
Project: 90498
Buggy source:
private SQL(String sql,Object... params){
  if (sql != null)   this.sql=sql.toLowerCase();
  this.params=params;
}

Fixed version (ground truth):
private SQL(String sql,Object... params){
  this.sql=sql;
  this.params=params;
}
Program: 90499
Project: 90499
Buggy source:
@Test public void testSaveBatch(){
  List<TestEntity> entities=new ArrayList<TestEntity>();
  TestEntity entity1=createEntity();
  TestEntity entity2=createEntity();
  entities.add(entity1);
  entities.add(entity2);
  IShardingKey<Number> key=new ShardingKey<Number>(CLUSTER_KLSTORAGE,1000001);
  Number[] pks=cacheClient.saveBatch(entities,key);
  List<TestEntity> entitiesFromDB=cacheClient.findByPks(key,TestEntity.class,pks);
  for (int i=0; i < entitiesFromDB.size(); i++) {
    Assert.assertEquals(entities.get(i),entitiesFromDB.get(i));
  }
  cacheClient.removeByPks(pks,key,TestEntity.class);
  entitiesFromDB=cacheClient.findByPks(key,TestEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}

Fixed version (ground truth):
@Test public void testSaveBatch(){
  List<TestEntity> entities=new ArrayList<TestEntity>();
  TestEntity entity1=createEntity();
  TestEntity entity2=createEntity();
  entities.add(entity1);
  entities.add(entity2);
  IShardingKey<Number> key=new ShardingKey<Number>(CLUSTER_KLSTORAGE,1000001);
  Number[] pks=cacheClient.saveBatch(entities,key);
  List<TestEntity> entitiesFromDB=cacheClient.findByPks(key,TestEntity.class,pks);
  for (int i=0; i < entitiesFromDB.size(); i++) {
    Assert.assertEquals(entities.get(i),entitiesFromDB.get(i));
  }
  cacheClient.removeByPks(key,TestEntity.class,pks);
  entitiesFromDB=cacheClient.findByPks(key,TestEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}
Program: 90500
Project: 90500
Buggy source:
@Test public void testGlobalUpdateBatch(){
  List<TestGlobalEntity> entities=new ArrayList<TestGlobalEntity>();
  TestGlobalEntity entity1=createGlobalEntity();
  TestGlobalEntity entity2=createGlobalEntity();
  entities.add(entity1);
  entities.add(entity2);
  Number[] pks=cacheClient.globalSaveBatch(entities,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> before=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  for (  TestGlobalEntity entity : before) {
    entity.setTestString("String_Node_Str");
  }
  cacheClient.globalUpdateBatch(before,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> after=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  for (int i=0; i < after.size(); i++) {
    Assert.assertEquals(before.get(i),after.get(i));
  }
  cacheClient.globalRemoveByPks(pks,TestGlobalEntity.class,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> entitiesFromDB=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}

Fixed version (ground truth):
@Test public void testGlobalUpdateBatch(){
  List<TestGlobalEntity> entities=new ArrayList<TestGlobalEntity>();
  TestGlobalEntity entity1=createGlobalEntity();
  TestGlobalEntity entity2=createGlobalEntity();
  entities.add(entity1);
  entities.add(entity2);
  Number[] pks=cacheClient.globalSaveBatch(entities,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> before=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  for (  TestGlobalEntity entity : before) {
    entity.setTestString("String_Node_Str");
  }
  cacheClient.globalUpdateBatch(before,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> after=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  for (int i=0; i < after.size(); i++) {
    Assert.assertEquals(before.get(i),after.get(i));
  }
  cacheClient.globalRemoveByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  List<TestGlobalEntity> entitiesFromDB=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}
Program: 90501
Project: 90501
Buggy source:
@Test public void testGlobalSaveBatch(){
  List<TestGlobalEntity> entities=new ArrayList<TestGlobalEntity>();
  TestGlobalEntity entity1=createGlobalEntity();
  TestGlobalEntity entity2=createGlobalEntity();
  entities.add(entity1);
  entities.add(entity2);
  Number[] pks=cacheClient.globalSaveBatch(entities,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> entitiesFromDB=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  for (int i=0; i < entitiesFromDB.size(); i++) {
    Assert.assertEquals(entities.get(i),entitiesFromDB.get(i));
  }
  cacheClient.globalRemoveByPks(pks,TestGlobalEntity.class,CLUSTER_KLSTORAGE);
  entitiesFromDB=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}

Fixed version (ground truth):
@Test public void testGlobalSaveBatch(){
  List<TestGlobalEntity> entities=new ArrayList<TestGlobalEntity>();
  TestGlobalEntity entity1=createGlobalEntity();
  TestGlobalEntity entity2=createGlobalEntity();
  entities.add(entity1);
  entities.add(entity2);
  Number[] pks=cacheClient.globalSaveBatch(entities,CLUSTER_KLSTORAGE);
  List<TestGlobalEntity> entitiesFromDB=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  for (int i=0; i < entitiesFromDB.size(); i++) {
    Assert.assertEquals(entities.get(i),entitiesFromDB.get(i));
  }
  cacheClient.globalRemoveByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  entitiesFromDB=cacheClient.findGlobalByPks(CLUSTER_KLSTORAGE,TestGlobalEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}
Program: 90502
Project: 90502
Buggy source:
@Test public void testUpdateBatch(){
  List<TestEntity> entities=new ArrayList<TestEntity>();
  TestEntity entity1=createEntity();
  TestEntity entity2=createEntity();
  entities.add(entity1);
  entities.add(entity2);
  IShardingKey<Number> key=new ShardingKey<Number>(CLUSTER_KLSTORAGE,1000001);
  Number[] pks=cacheClient.saveBatch(entities,key);
  List<TestEntity> before=cacheClient.findByPks(key,TestEntity.class,pks);
  for (  TestEntity entity : before) {
    entity.setTestDate(new Date());
  }
  cacheClient.updateBatch(before,key);
  List<TestEntity> after=cacheClient.findByPks(key,TestEntity.class,pks);
  for (int i=0; i < after.size(); i++) {
    Assert.assertEquals(before.get(i),after.get(i));
  }
  cacheClient.removeByPks(pks,key,TestEntity.class);
  List<TestEntity> entitiesFromDB=cacheClient.findByPks(key,TestEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}

Fixed version (ground truth):
@Test public void testUpdateBatch(){
  List<TestEntity> entities=new ArrayList<TestEntity>();
  TestEntity entity1=createEntity();
  TestEntity entity2=createEntity();
  entities.add(entity1);
  entities.add(entity2);
  IShardingKey<Number> key=new ShardingKey<Number>(CLUSTER_KLSTORAGE,1000001);
  Number[] pks=cacheClient.saveBatch(entities,key);
  List<TestEntity> before=cacheClient.findByPks(key,TestEntity.class,pks);
  for (  TestEntity entity : before) {
    entity.setTestDate(new Date());
  }
  cacheClient.updateBatch(before,key);
  List<TestEntity> after=cacheClient.findByPks(key,TestEntity.class,pks);
  for (int i=0; i < after.size(); i++) {
    Assert.assertEquals(before.get(i),after.get(i));
  }
  cacheClient.removeByPks(key,TestEntity.class,pks);
  List<TestEntity> entitiesFromDB=cacheClient.findByPks(key,TestEntity.class,pks);
  Assert.assertTrue(entitiesFromDB.isEmpty());
}
Program: 90503
Project: 90503
Buggy source:
@Test public void remove() throws Exception {
  IShardingKey<?> shardingValue=new ShardingKey<Integer>(CLUSTER_KLSTORAGE,1);
  DB db=cacheClient.getDbCluster().selectDbFromMaster("String_Node_Str",shardingValue);
  primaryCache.remove(db,1);
  Assert.assertNull(primaryCache.get(db,1));
  for (int i=2; i <= 10; i++) {
    primaryCache.remove(db,2,3,4,5,6,7,8,9,10);
  }
  for (int i=2; i <= 10; i++) {
    Assert.assertNull(primaryCache.get(db,i));
  }
}

Fixed version (ground truth):
@Test public void remove() throws Exception {
  IShardingKey<?> shardingValue=new ShardingKey<Integer>(CLUSTER_KLSTORAGE,1);
  DB db=cacheClient.getDbCluster().selectDbFromMaster("String_Node_Str",shardingValue);
  primaryCache.remove(db,1);
  Assert.assertNull(primaryCache.get(db,1));
  for (int i=2; i <= 10; i++) {
    primaryCache.remove(db,Arrays.asList(new Number[]{2,3,4,5,5,6}));
  }
  for (int i=2; i <= 10; i++) {
    Assert.assertNull(primaryCache.get(db,i));
  }
}
Program: 90504
Project: 90504
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Number save(Object entity,IShardingKey shardingKey){
  String tableName=ReflectUtil.getTableName(entity.getClass());
  long pk=this.idGenerator.genClusterUniqueLongId(dbCluster,shardingKey.getClusterName(),tableName);
  try {
    if (shardingKey.getValue() == null) {
      ReflectUtil.setPkValue(entity,pk);
      shardingKey.setValue(pk);
    }
 else     if (shardingKey.getValue() instanceof Number) {
      if (((Number)shardingKey.getValue()).intValue() == 0) {
        ReflectUtil.setPkValue(entity,pk);
        shardingKey.setValue(pk);
      }
    }
  }
 catch (  Exception e) {
    throw new DBOperationException(e);
  }
  DB db=_getDbFromMaster(tableName,shardingKey);
  List<Object> entities=new ArrayList<Object>(1);
  entities.add(entity);
  Connection conn=null;
  try {
    conn=db.getDatasource().getConnection();
    _saveBatch(conn,entities,db.getTableIndex());
  }
 catch (  Exception e) {
    throw new DBOperationException(e);
  }
 finally {
    SQLBuilder.close(conn);
  }
  if (primaryCache != null) {
    primaryCache.put(db,pk,entity);
    primaryCache.incrCount(db,1);
  }
  return pk;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Number save(Object entity,IShardingKey shardingKey){
  String tableName=ReflectUtil.getTableName(entity.getClass());
  long pk=this.idGenerator.genClusterUniqueLongId(dbCluster,shardingKey.getClusterName(),tableName);
  try {
    ReflectUtil.setPkValue(entity,pk);
  }
 catch (  Exception e) {
    throw new DBOperationException(e);
  }
  if (shardingKey.getValue() instanceof Number) {
    if (shardingKey.getValue() == null || ((Number)shardingKey.getValue()).intValue() == 0) {
      shardingKey.setValue(pk);
    }
  }
 else   if (shardingKey.getValue() instanceof String) {
    if (shardingKey.getValue() == null) {
      throw new DBOperationException("String_Node_Str");
    }
  }
 else {
    throw new DBOperationException("String_Node_Str");
  }
  DB db=_getDbFromMaster(tableName,shardingKey);
  List<Object> entities=new ArrayList<Object>(1);
  entities.add(entity);
  Connection conn=null;
  try {
    conn=db.getDatasource().getConnection();
    _saveBatch(conn,entities,db.getTableIndex());
  }
 catch (  Exception e) {
    throw new DBOperationException(e);
  }
 finally {
    SQLBuilder.close(conn);
  }
  if (primaryCache != null) {
    primaryCache.put(db,pk,entity);
    primaryCache.incrCount(db,1);
  }
  return pk;
}
Program: 90505
Project: 90505
Buggy source:
/** 
 * 通过反射给对象属性赋值.
 * @param obj 被反射的对象
 * @param propertyName 赋值的属性名
 * @param value 值
 * @throws Exception 操作失败
 */
public static void setProperty(Object obj,String propertyName,Object value) throws Exception {
  Field f=obj.getClass().getDeclaredField(propertyName);
  f.setAccessible(true);
  f.set(obj,value);
}

Fixed version (ground truth):
/** 
 * 通过反射给对象属性赋值.
 * @param obj 被反射的对象
 * @param propertyName 赋值的属性名
 * @param value 值
 * @throws Exception 操作失败
 */
public static void setProperty(Object obj,String propertyName,Object value) throws Exception {
  Field f=obj.getClass().getDeclaredField(propertyName);
  f.setAccessible(true);
  if (value instanceof Number) {
    Number numValue=(Number)value;
    if (f.getType() == Integer.TYPE || f.getType() == Integer.class) {
      f.setInt(obj,numValue.intValue());
    }
 else     if (f.getType() == Long.TYPE || f.getType() == Long.class) {
      f.setLong(obj,numValue.longValue());
    }
 else     if (f.getType() == Short.TYPE || f.getType() == Short.class) {
      f.setShort(obj,numValue.shortValue());
    }
 else     if (f.getType() == Float.TYPE || f.getType() == Float.class) {
      f.setFloat(obj,numValue.floatValue());
    }
 else     if (f.getType() == Double.TYPE || f.getType() == Double.class) {
      f.setDouble(obj,numValue.doubleValue());
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 else {
    f.set(obj,value);
  }
}
Program: 90507
Project: 90507
Buggy source:
@Override public void processAction(ActionRequest portletReq,ActionResponse portletResp) throws PortletException, IOException {
}

Fixed version (ground truth):
@Override @ActionMethod(portletName="String_Node_Str",publishingEvents={@PortletQName(namespaceURI="String_Node_Str",localPart="String_Node_Str")}) public void processAction(ActionRequest portletReq,ActionResponse portletResp) throws PortletException, IOException {
  MutableRenderParameters mrp=portletResp.getRenderParameters();
  String testcase=mrp.getValue("String_Node_Str");
  ActionParameters ap=portletReq.getActionParameters();
  if (testcase == null || testcase.isEmpty()) {
    mrp.setValue("String_Node_Str","String_Node_Str");
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION1)) {
    mrp.setValue("String_Node_Str","String_Node_Str");
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION2)) {
    String param=ap.getValue("String_Node_Str");
    String status="String_Node_Str";
    if (param == null || !param.equals("String_Node_Str")) {
      status="String_Node_Str" + param;
    }
    mrp.setValue("String_Node_Str",status);
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION3)) {
    String formParam=ap.getValue("String_Node_Str");
    String status="String_Node_Str";
    if (formParam == null || !formParam.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION3)) {
      status="String_Node_Str" + formParam;
    }
    mrp.setValue("String_Node_Str",status);
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION4)) {
    String param=ap.getValue("String_Node_Str");
    String formParam=ap.getValue("String_Node_Str");
    String status="String_Node_Str";
    if (formParam == null || !formParam.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION4)) {
      status="String_Node_Str" + formParam;
    }
 else     if (param == null || !param.equals("String_Node_Str")) {
      status="String_Node_Str" + param;
    }
    mrp.setValue("String_Node_Str",status);
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION5)) {
    mrp.setValue("String_Node_Str","String_Node_Str");
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION6)) {
    QName qname=new QName("String_Node_Str","String_Node_Str");
    portletResp.setEvent(qname,"String_Node_Str");
    ;
  }
 else   if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION7)) {
    mrp.setValue("String_Node_Str","String_Node_Str");
  }
}
Program: 90508
Project: 90508
Buggy source:
/** 
 * Invoke the method with the arguments provided. It is expected that this method is called  is called by a proxy or facade for the method / class.
 * @param args    Arguments
 * @return        Object returned by method
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException
 */
public Object invoke(Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  if (!isPortletClass) {
    beanInstance=beanMgr.getReference(bean,bean.getBeanClass(),beanMgr.createCreationalContext(bean));
  }
  return meth.invoke(beanInstance,args);
}

Fixed version (ground truth):
/** 
 * Invoke the method with the arguments provided. It is expected that this method is called  is called by a proxy or facade for the method / class.
 * @param args    Arguments
 * @return        Object returned by method
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws InvocationTargetException
 */
public Object invoke(Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  if (!isPortletClass) {
    if (isTrace) {
      StringBuilder txt=new StringBuilder();
      txt.append("String_Node_Str").append(toString());
      txt.append("String_Node_Str").append(beanMgr == null);
      txt.append("String_Node_Str").append(bean == null);
      LOG.trace(txt.toString());
    }
    beanInstance=beanMgr.getReference(bean,bean.getBeanClass(),beanMgr.createCreationalContext(bean));
  }
  return meth.invoke(beanInstance,args);
}
Program: 90509
Project: 90509
Buggy source:
/** 
 * Scans the servlet context classes and libraries for portlet method annotations.
 * @param ctx     the servlet context
 */
public void scanContext(ServletContext ctx){
  Set<File> files;
  files=getClassFilesForPath(ctx,CLASSDIR);
  scanFiles(files);
  files=getLibFilesForPath(ctx,LIBDIR);
  scanFiles(files);
  activateAnnotatedMethods(null);
}

Fixed version (ground truth):
/** 
 * Scans the servlet context classes and libraries for portlet method annotations.
 * @param ctx     the servlet context
 */
public void scanContext(ServletContext ctx){
  Set<File> files;
  files=getClassFilesForPath(ctx,CLASSDIR);
  scanFiles(files);
  files=getLibFilesForPath(ctx,LIBDIR);
  scanFiles(files);
}
Program: 90510
Project: 90510
Buggy source:
/** 
 * After the bean container has validated the deployment from its point of view, do some checking from the portlet point of view. Activate the portlet deployment by passing in a bean manager in order to create the required portlet bean instances.
 * @param adv
 * @param bm
 * @throws InvalidAnnotationException
 */
void afterDeploymentValidation(@Observes AfterDeploymentValidation adv,BeanManager bm) throws InvalidAnnotationException {
  par.activateCustomScopes(bm);
  par.activateAnnotatedMethods(bm);
  LOG.trace("String_Node_Str");
  Set<Bean<?>> beans=bm.getBeans(AnnotatedConfigBean.class);
  @SuppressWarnings("String_Node_Str") Bean<AnnotatedConfigBean> bean=(Bean<AnnotatedConfigBean>)bm.resolve(beans);
  if (bean != null) {
    LOG.trace("String_Node_Str" + bean.getBeanClass().getCanonicalName());
    try {
      CreationalContext<AnnotatedConfigBean> cc=bm.createCreationalContext(bean);
      acb=(AnnotatedConfigBean)bm.getReference(bean,AnnotatedConfigBean.class,cc);
      LOG.trace("String_Node_Str");
      acb.setMethodStore(ams);
      acb.setSummary(summary);
      acb.setStateScopedConfig(par.getStateScopedConfig());
      acb.setSessionScopedConfig(par.getSessionScopedConfig());
    }
 catch (    Exception e) {
      StringBuilder txt=new StringBuilder(128);
      txt.append("String_Node_Str");
      txt.append(e.toString());
      LOG.warn(txt.toString());
    }
  }
 else {
    LOG.warn("String_Node_Str");
  }
  LOG.info("String_Node_Str" + acb);
}

Fixed version (ground truth):
/** 
 * After the bean container has validated the deployment from its point of view, do some checking from the portlet point of view. Activate the portlet deployment by passing in a bean manager in order to create the required portlet bean instances.
 * @param adv
 * @param bm
 * @throws InvalidAnnotationException
 */
void afterDeploymentValidation(@Observes AfterDeploymentValidation adv,BeanManager bm) throws InvalidAnnotationException {
  par.activateCustomScopes(bm);
  LOG.trace("String_Node_Str");
  Set<Bean<?>> beans=bm.getBeans(AnnotatedConfigBean.class);
  @SuppressWarnings("String_Node_Str") Bean<AnnotatedConfigBean> bean=(Bean<AnnotatedConfigBean>)bm.resolve(beans);
  if (bean != null) {
    LOG.trace("String_Node_Str" + bean.getBeanClass().getCanonicalName());
    try {
      CreationalContext<AnnotatedConfigBean> cc=bm.createCreationalContext(bean);
      acb=(AnnotatedConfigBean)bm.getReference(bean,AnnotatedConfigBean.class,cc);
      LOG.trace("String_Node_Str");
      acb.setMethodStore(ams);
      acb.setSummary(summary);
      acb.setStateScopedConfig(par.getStateScopedConfig());
      acb.setSessionScopedConfig(par.getSessionScopedConfig());
    }
 catch (    Exception e) {
      StringBuilder txt=new StringBuilder(128);
      txt.append("String_Node_Str");
      txt.append(e.toString());
      LOG.warn(txt.toString());
    }
  }
 else {
    LOG.warn("String_Node_Str");
  }
  LOG.info("String_Node_Str" + acb);
}
Program: 90511
Project: 90511
Buggy source:
/** 
 * Scans list of files for method annotations. (unit test execution path)
 * @param files   the set of files to scan
 */
public void scanMethodAnnotations(Set<File> files){
  MethodAnnotationRecognizer mar=new MethodAnnotationRecognizer(methodStore,configSummary);
  mar.scanFiles(files);
  mar.activateAnnotatedMethods(null);
  LOG.debug("String_Node_Str" + methodStore.getMethodsAsString());
}

Fixed version (ground truth):
/** 
 * Scans list of files for method annotations. (unit test execution path)
 * @param files   the set of files to scan
 */
public void scanMethodAnnotations(Set<File> files){
  MethodAnnotationRecognizer mar=new MethodAnnotationRecognizer(methodStore,configSummary);
  mar.scanFiles(files);
  LOG.debug("String_Node_Str" + methodStore.getMethodsAsString());
}
Program: 90512
Project: 90512
Buggy source:
/** 
 * Reconciles the bean configuration with the config from annotations & portlet DD.
 */
public void reconcileBeanConfig(AnnotatedMethodStore ams){
  if (jcp == null) {
    jcp=new JSR362ConfigurationProcessor(pad);
  }
  jcp.reconcileBeanConfig(ams);
  jcp.instantiatePortlets(ams,ams.getBeanMgr());
}

Fixed version (ground truth):
/** 
 * Reconciles the bean configuration with the config from annotations & portlet DD.
 */
public void reconcileBeanConfig(){
  if (jcp == null) {
    jcp=new JSR362ConfigurationProcessor(pad);
  }
  jcp.reconcileBeanConfig(methodStore);
}
Program: 90515
Project: 90515
Buggy source:
/** 
 * Throws exception if argument is null.
 * @param msg
 * @param vals
 */
protected void checkNull(String msg,Object... vals){
  if (vals == null) {
    throw new IllegalArgumentException("String_Node_Str" + msg + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Throws exception if argument is null.
 * @param msg
 * @param val
 */
protected void checkNull(String msg,Object val){
  if (val == null) {
    throw new IllegalArgumentException("String_Node_Str" + msg + "String_Node_Str");
  }
}
Program: 90516
Project: 90516
Buggy source:
/** 
 * Checks if the specified content type is valid (supported by the portlet). The specified content type should be a tripped mime type without any character encoding suffix.
 * @param contentType  the content type to check.
 * @return true if the content type is valid, false otherwise.
 */
protected boolean isValidContentType(String contentType){
  boolean valid=false;
  for (  String supportedType : getResponseContentTypes()) {
    if (supportedType.equals(contentType)) {
      valid=true;
    }
 else     if (supportedType.indexOf("String_Node_Str") >= 0) {
      int index=supportedType.indexOf("String_Node_Str");
      String supportedPrefix=supportedType.substring(0,index);
      String supportedSuffix=supportedType.substring(index + 1);
      index=contentType.indexOf("String_Node_Str");
      String typePrefix=contentType.substring(0,index);
      String typeSuffix=contentType.substring(index + 1);
      if (supportedPrefix.equals("String_Node_Str") || supportedPrefix.equals(typePrefix)) {
        if (supportedSuffix.equals("String_Node_Str") || supportedSuffix.equals(typeSuffix)) {
          valid=true;
        }
      }
    }
  }
  return valid;
}

Fixed version (ground truth):
/** 
 * Checks if the specified content type is valid (supported by the portlet). The specified content type should be a tripped mime type without any character encoding suffix.
 * @param contentType the content type to check.
 * @return true if the content type is valid, false otherwise.
 */
protected boolean isValidContentType(String contentType){
}
Program: 90517
Project: 90517
Buggy source:
@Override public void setContentType(String contentType){
  ArgumentUtility.validateNotNull("String_Node_Str",contentType);
  int index=contentType.indexOf(';');
  if (index != -1) {
    contentType=contentType.substring(0,index);
  }
  contentType=contentType.trim();
  if (!isValidContentType(contentType)) {
    throw new IllegalArgumentException("String_Node_Str" + contentType + "String_Node_Str");
  }
  super.setContentType(contentType);
}

Fixed version (ground truth):
@Override public void setContentType(String contentType){
  ArgumentUtility.validateNotNull("String_Node_Str",contentType);
  contentType=contentType.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
  if (!isValidContentType(contentType)) {
    throw new IllegalArgumentException("String_Node_Str" + contentType + "String_Node_Str");
  }
  super.setContentType(contentType);
}