nus-yam/ex-repair huggingface dataset:
Program: 172365
Project: 172365
Buggy source:
private void hurtRank(){
  List<HurtRecord> list=new ArrayList<>(worldBossData.getHurtMap().values());
  Collections.sort(list,SORT);
  worldBossData.getTop10().clear();
  worldBossData.getRankMap().clear();
  int size=0;
  for (int i=0; i < list.size(); i++) {
    HurtRecord hr=list.get(i);
    int rank=i + 1;
    hr.setRank(rank);
    HurtRecord selfRank=new HurtRecord();
    selfRank.setCurHurt(hr.getCurHurt());
    selfRank.setRank(rank);
    worldBossData.getRankMap().put(hr.getPlayerId(),selfRank);
    if (size < 10) {
      HurtRecord top10Hr=new HurtRecord(hr.getPlayerId(),hr.getName());
      top10Hr.setCurHurt(hr.getCurHurt());
      top10Hr.setHurt(hr.getHurt());
      top10Hr.setRank(hr.getRank());
      worldBossData.getTop10().add(top10Hr);
    }
  }
}

Fixed version (ground truth):
private List<HurtRecord> hurtRank(){
  try {
    wbLock.lock();
    List<HurtRecord> list=new ArrayList<>(worldBossData.getHurtMap().values());
    Collections.sort(list,SORT);
    List<HurtRecord> top10List=new ArrayList<>();
    Map<Integer,HurtRecord> rankMap=new HashMap<>();
    for (int i=0; i < list.size(); i++) {
      HurtRecord hr=list.get(i);
      int rank=i + 1;
      hr.setRank(rank);
      HurtRecord selfRank=new HurtRecord();
      selfRank.setCurHurt(hr.getCurHurt());
      selfRank.setRank(rank);
      rankMap.put(hr.getPlayerId(),selfRank);
      if (rank <= 10) {
        HurtRecord top10Hr=new HurtRecord(hr.getPlayerId(),hr.getName());
        top10Hr.setCurHurt(hr.getCurHurt());
        top10Hr.setHurt(hr.getHurt());
        top10Hr.setRank(hr.getRank());
        top10List.add(top10Hr);
      }
    }
    worldBossData.setTop10(top10List);
    worldBossData.setRankMap(rankMap);
    return list;
  }
  finally {
    wbLock.unlock();
  }
}
Program: 172366
Project: 172366
Buggy source:
/** 
 * 获取历史伤害排名
 */
public Object getHistoryHurtList(int playerId){
  WorldBossHurtRankVO vo=new WorldBossHurtRankVO();
  vo.rankList=new ArrayList<>();
  for (  HurtRecord hr : worldBossData.getTop10()) {
    WorldBossHurtVO vo1=new WorldBossHurtVO();
    vo1.hurt=hr.getHurt();
    vo1.nickName=hr.getName();
    vo.rankList.add(vo1);
  }
  HurtRecord hr=worldBossData.getRankMap().get(playerId);
  if (hr != null) {
    vo.selfRank=hr.getRank();
    vo.hurt=hr.getCurHurt();
  }
  return vo;
}

Fixed version (ground truth):
/** 
 * 获取历史伤害排名
 */
public Object getHistoryHurtList(int playerId){
  List<HurtRecord> list=worldBossData.getTop10();
  WorldBossHurtRankVO vo=toRankProto(list);
  Map<Integer,HurtRecord> rankMap=worldBossData.getRankMap();
  HurtRecord hr=rankMap.get(playerId);
  if (hr != null) {
    vo.selfRank=hr.getRank();
    vo.hurt=hr.getCurHurt();
  }
  return vo;
}
Program: 172367
Project: 172367
Buggy source:
@Override public void handleInit(){
  size=10;
  Integer curMaxId=worldBossDao.selectMaxId();
  if (curMaxId == null) {
    curMaxId=1;
  }
 else {
    byte[] data=worldBossDao.selectWorldBossRecords(curMaxId);
    if (data != null) {
      worldBossData=JsonUtils.string2Object(new String(CompressUtil.decompressBytes(data),Charset.forName("String_Node_Str")),WorldRecord.class);
      List<HurtRecord> list=new ArrayList<>(worldBossData.getHurtMap().values());
      Collections.sort(list,SORT);
      int n=list.size() > size ? size : list.size();
      for (int i=0; i < n; i++) {
        treeMap.put(list.get(i),list.get(i));
      }
    }
  }
  if (worldBossData == null) {
    worldBossData=new WorldRecord();
  }
  try {
    idLock.lock();
    maxId=(curMaxId / 1000);
  }
  finally {
    idLock.unlock();
  }
  checkActivity();
  Calendar c=Calendar.getInstance();
  int second=c.get(Calendar.SECOND);
  timerService.scheduleAtFixedRate(new Runnable(){
    @Override public void run(){
      try {
        checkActivity();
      }
 catch (      Exception e) {
        ServerLogger.err(e,"String_Node_Str");
      }
    }
  }
,60 - second,60,TimeUnit.SECONDS);
  timerService.scheduleAtFixedRate(new Runnable(){
    @Override public void run(){
      try {
        if (worldBossData.getbUpdate().get()) {
          saveData();
          worldBossData.setbUpdate(false);
        }
      }
 catch (      Exception e) {
        ServerLogger.err(e,"String_Node_Str");
      }
    }
  }
,1,1,TimeUnit.MINUTES);
}

Fixed version (ground truth):
@Override public void handleInit(){
  size=10;
  Integer curMaxId=worldBossDao.selectMaxId();
  if (curMaxId == null) {
    curMaxId=1;
  }
 else {
    byte[] data=worldBossDao.selectWorldBossRecords(curMaxId);
    if (data != null) {
      worldBossData=JsonUtils.string2Object(new String(CompressUtil.decompressBytes(data),Charset.forName("String_Node_Str")),WorldRecord.class);
      List<HurtRecord> list=new ArrayList<>(worldBossData.getHurtMap().values());
      Collections.sort(list,SORT);
      int n=list.size() > size ? size : list.size();
      for (int i=0; i < n; i++) {
        treeMap.put(list.get(i),list.get(i));
      }
    }
  }
  if (worldBossData == null) {
    worldBossData=new WorldRecord();
  }
  try {
    wbLock.lock();
    maxId=(curMaxId / 1000);
  }
  finally {
    wbLock.unlock();
  }
  checkActivity();
  Calendar c=Calendar.getInstance();
  int second=c.get(Calendar.SECOND);
  timerService.scheduleAtFixedRate(new Runnable(){
    @Override public void run(){
      try {
        checkActivity();
      }
 catch (      Exception e) {
        ServerLogger.err(e,"String_Node_Str");
      }
    }
  }
,60 - second,60,TimeUnit.SECONDS);
  timerService.scheduleAtFixedRate(new Runnable(){
    @Override public void run(){
      try {
        if (worldBossData.getbUpdate().get()) {
          saveData();
          worldBossData.setbUpdate(false);
        }
      }
 catch (      Exception e) {
        ServerLogger.err(e,"String_Node_Str");
      }
    }
  }
,1,1,TimeUnit.MINUTES);
}
Program: 172368
Project: 172368
Buggy source:
private int getNextId(){
  try {
    idLock.lock();
    maxId++;
    return maxId * 1000 + SysConfig.serverId;
  }
  finally {
    idLock.unlock();
  }
}

Fixed version (ground truth):
private int getNextId(){
  try {
    wbLock.lock();
    maxId++;
    return maxId * 1000 + SysConfig.serverId;
  }
  finally {
    wbLock.unlock();
  }
}
Program: 172370
Project: 172370
Buggy source:
public ListParam<Reward> takeTrainingReward(int playerId){
  ListParam<Reward> result=new ListParam<Reward>();
  Player player=playerService.getPlayer(playerId);
  Gang gang=getGang(player.getGangId());
  if (gang == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GMember member=gang.getMembers().get(playerId);
  if (member.getStartTraining() == 0) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GTRoom room=gang.getGtRoom();
  if (room == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GangTrainingCfg cfg=GameData.getConfig(GangTrainingCfg.class,room.getId());
  float plus=Math.min(room.getMax() * cfg.rewardPlus[1],cfg.rewardPlus[0]);
  int hour=(int)member.getTrainingTime();
  int[][] rewards=calculateReward(member,room,plus);
  member.setStartTraining(0L);
  if (rewards != null) {
    result.params=new ArrayList<Reward>();
    goodsService.addRewards(playerId,rewards,LogConsume.GANG_TRAINING_REWARD,room.getId(),member.getTrainingTime() - hour);
    for (    int[] reward : rewards) {
      Reward re=new Reward();
      re.id=reward[0];
      re.count=reward[1];
      result.params.add(re);
    }
  }
  return result;
}

Fixed version (ground truth):
public ListParam<Reward> takeTrainingReward(int playerId){
  ListParam<Reward> result=new ListParam<Reward>();
  Player player=playerService.getPlayer(playerId);
  Gang gang=getGang(player.getGangId());
  if (gang == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GMember member=gang.getMembers().get(playerId);
  if (member.getStartTraining() == 0) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GTRoom room=gang.getGtRoom();
  if (room == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  room.setMax(room.getMax() - 1);
  GangTrainingCfg cfg=GameData.getConfig(GangTrainingCfg.class,room.getId());
  float plus=Math.min(room.getMax() * cfg.rewardPlus[1],cfg.rewardPlus[0]);
  int hour=(int)member.getTrainingTime();
  int[][] rewards=calculateReward(member,room,plus);
  member.setStartTraining(0L);
  if (rewards != null) {
    result.params=new ArrayList<Reward>();
    goodsService.addRewards(playerId,rewards,LogConsume.GANG_TRAINING_REWARD,room.getId(),member.getTrainingTime() - hour);
    for (    int[] reward : rewards) {
      Reward re=new Reward();
      re.id=reward[0];
      re.count=reward[1];
      result.params.add(re);
    }
  }
  return result;
}
Program: 172371
Project: 172371
Buggy source:
/** 
 * 1、玩家掉线 2、玩家退出 3、心跳检测
 * @param playerId
 */
public void onExit(int playerId){
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    if (group != null) {
      int oldId=group.getHostId();
      int masterId=group.removePlayer(playerId);
      ServerLogger.warn("String_Node_Str" + playerId + "String_Node_Str"+ masterId);
      heartBeatMap.invalidate(playerId);
      ServerLogger.warn("String_Node_Str" + oldId + "String_Node_Str"+ masterId);
      if (oldId != masterId) {
        pushHost(masterId);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * 1、玩家掉线 2、玩家退出 3、心跳检测
 * @param playerId
 */
public void onExit(int playerId){
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    if (group != null) {
      int oldId=group.getHostId();
      int masterId=group.removePlayer(playerId);
      ServerLogger.warn("String_Node_Str" + playerId + "String_Node_Str"+ masterId);
      if (group.getAll().isEmpty()) {
        multiMap.remove(key);
      }
      heartBeatMap.invalidate(playerId);
      ServerLogger.warn("String_Node_Str" + oldId + "String_Node_Str"+ masterId);
      if (oldId != masterId) {
        pushHost(masterId);
      }
    }
  }
}
Program: 172372
Project: 172372
Buggy source:
/** 
 * 主机判断心跳
 * @param playerId
 * @return
 */
public IntParam hostHeart(int playerId){
  IntParam param=new IntParam();
  heartBeatMap.put(playerId,System.currentTimeMillis());
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    param.param=group.getHostId();
  }
  return param;
}

Fixed version (ground truth):
/** 
 * 主机判断心跳
 * @param playerId
 * @return
 */
public IntParam hostHeart(int playerId){
  IntParam param=new IntParam();
  heartBeatMap.put(playerId,System.currentTimeMillis());
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    if (group != null) {
      param.param=group.getHostId();
    }
  }
  return param;
}
Program: 172375
Project: 172375
Buggy source:
public List<Integer> genRefreshs(int playerId,int type){
  Player player=playerService.getPlayer(playerId);
  List<Integer> ids=new ArrayList<Integer>(ConfigData.RefreshIds.get(type));
  List<Integer> rates=new ArrayList<Integer>(ConfigData.RefreshRates.get(type));
  List<Integer> result=new ArrayList<Integer>();
  int size=ids.size();
  for (int i=0; i < size; i++) {
    ShopCfg cfg=ConfigData.getConfig(ShopCfg.class,ids.get(i));
    if (cfg.isFixed) {
      result.add(ids.get(i));
      rates.set(i,0);
    }
  }
  if (result.size() < 6) {
    for (int i=0; i < 60; i++) {
      int index=RandomUtil.getRandomIndex(rates);
      ShopCfg cfg=ConfigData.getConfig(ShopCfg.class,ids.get(index));
      if (cfg == null) {
        ServerLogger.warn("String_Node_Str" + ids.get(index));
        continue;
      }
      GoodsConfig gCfg=ConfigData.getConfig(GoodsConfig.class,cfg.goodsId);
      if (gCfg == null) {
        ServerLogger.warn("String_Node_Str" + cfg.id);
        continue;
      }
      if ((gCfg.vocation != 0 && gCfg.vocation != player.getVocation())) {
        continue;
      }
      result.add(ids.get(index));
      rates.set(index,0);
      if (result.size() >= 6) {
        break;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public List<Integer> genRefreshs(int playerId,int type){
  Player player=playerService.getPlayer(playerId);
  List<Integer> ids=new ArrayList<Integer>(ConfigData.RefreshIds.get(type));
  List<Integer> rates=new ArrayList<Integer>(ConfigData.RefreshRates.get(type));
  List<Integer> result=new ArrayList<Integer>();
  int size=ids.size();
  for (int i=0; i < size; i++) {
    ShopCfg cfg=ConfigData.getConfig(ShopCfg.class,ids.get(i));
    if (cfg.isFixed) {
      result.add(ids.get(i));
      rates.set(i,0);
    }
  }
  int n=6;
  if (type == COMMON) {
    n=10;
  }
  if (result.size() < n) {
    for (int i=0; i < 60; i++) {
      int index=RandomUtil.getRandomIndex(rates);
      ShopCfg cfg=ConfigData.getConfig(ShopCfg.class,ids.get(index));
      if (cfg == null) {
        ServerLogger.warn("String_Node_Str" + ids.get(index));
        continue;
      }
      GoodsConfig gCfg=ConfigData.getConfig(GoodsConfig.class,cfg.goodsId);
      if (gCfg == null) {
        ServerLogger.warn("String_Node_Str" + cfg.id);
        continue;
      }
      if ((gCfg.vocation != 0 && gCfg.vocation != player.getVocation())) {
        continue;
      }
      result.add(ids.get(index));
      rates.set(index,0);
      if (result.size() >= n) {
        break;
      }
    }
  }
  return result;
}
Program: 172378
Project: 172378
Buggy source:
public ListParam<Reward> takeTrainingReward(int playerId){
  ListParam<Reward> result=new ListParam<Reward>();
  Player player=playerService.getPlayer(playerId);
  Gang gang=getGang(player.getGangId());
  if (gang == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GMember member=gang.getMembers().get(playerId);
  if (member.getStartTraining() == 0) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GTRoom room=gang.getGtRoom();
  if (room == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GangTrainingCfg cfg=GameData.getConfig(GangTrainingCfg.class,room.getId());
  float plus=Math.min(room.getMax() * cfg.rewardPlus[1],cfg.rewardPlus[0]);
  int hour=(int)member.getTrainingTime();
  int[][] rewards=calculateReward(member,room,plus);
  member.setStartTraining(0L);
  if (rewards != null) {
    result.params=new ArrayList<Reward>();
    goodsService.addRewards(playerId,rewards,LogConsume.GANG_TRAINING_REWARD,room.getId(),member.getTrainingTime() - hour);
    for (    int[] reward : rewards) {
      Reward re=new Reward();
      re.id=reward[0];
      re.count=reward[1];
      result.params.add(re);
    }
  }
  return result;
}

Fixed version (ground truth):
public ListParam<Reward> takeTrainingReward(int playerId){
  ListParam<Reward> result=new ListParam<Reward>();
  Player player=playerService.getPlayer(playerId);
  Gang gang=getGang(player.getGangId());
  if (gang == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GMember member=gang.getMembers().get(playerId);
  if (member.getStartTraining() == 0) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  GTRoom room=gang.getGtRoom();
  if (room == null) {
    result.code=Response.ERR_PARAM;
    return result;
  }
  room.setMax(room.getMax() - 1);
  GangTrainingCfg cfg=GameData.getConfig(GangTrainingCfg.class,room.getId());
  float plus=Math.min(room.getMax() * cfg.rewardPlus[1],cfg.rewardPlus[0]);
  int hour=(int)member.getTrainingTime();
  int[][] rewards=calculateReward(member,room,plus);
  member.setStartTraining(0L);
  if (rewards != null) {
    result.params=new ArrayList<Reward>();
    goodsService.addRewards(playerId,rewards,LogConsume.GANG_TRAINING_REWARD,room.getId(),member.getTrainingTime() - hour);
    for (    int[] reward : rewards) {
      Reward re=new Reward();
      re.id=reward[0];
      re.count=reward[1];
      result.params.add(re);
    }
  }
  return result;
}
Program: 172379
Project: 172379
Buggy source:
public void addPetMaterial(int playerId,String... params){
  int petId=Integer.valueOf(params[0]);
  int count=Integer.valueOf(params[1]);
  petService.addPetMaterial(playerId,petId,count);
}

Fixed version (ground truth):
public void addPetMaterial(int playerId,String... params){
  int petId=Integer.valueOf(params[0]);
  int count=Integer.valueOf(params[1]);
  petService.addPetMaterial(playerId,petId,count,true);
}
Program: 172381
Project: 172381
Buggy source:
/** 
 * 1、玩家掉线 2、玩家退出 3、心跳检测
 * @param playerId
 */
public void onExit(int playerId){
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    if (group != null) {
      int oldId=group.getHostId();
      int masterId=group.removePlayer(playerId);
      ServerLogger.warn("String_Node_Str" + playerId + "String_Node_Str"+ masterId);
      heartBeatMap.invalidate(playerId);
      ServerLogger.warn("String_Node_Str" + oldId + "String_Node_Str"+ masterId);
      if (oldId != masterId) {
        pushHost(masterId);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * 1、玩家掉线 2、玩家退出 3、心跳检测
 * @param playerId
 */
public void onExit(int playerId){
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    if (group != null) {
      int oldId=group.getHostId();
      int masterId=group.removePlayer(playerId);
      ServerLogger.warn("String_Node_Str" + playerId + "String_Node_Str"+ masterId);
      if (group.getAll().isEmpty()) {
        multiMap.remove(key);
      }
      heartBeatMap.invalidate(playerId);
      ServerLogger.warn("String_Node_Str" + oldId + "String_Node_Str"+ masterId);
      if (oldId != masterId) {
        pushHost(masterId);
      }
    }
  }
}
Program: 172382
Project: 172382
Buggy source:
/** 
 * 主机判断心跳
 * @param playerId
 * @return
 */
public IntParam hostHeart(int playerId){
  IntParam param=new IntParam();
  heartBeatMap.put(playerId,System.currentTimeMillis());
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    param.param=group.getHostId();
  }
  return param;
}

Fixed version (ground truth):
/** 
 * 主机判断心跳
 * @param playerId
 * @return
 */
public IntParam hostHeart(int playerId){
  IntParam param=new IntParam();
  heartBeatMap.put(playerId,System.currentTimeMillis());
  Player player=playerService.getPlayer(playerId);
  SceneConfig lastCfg=GameData.getConfig(SceneConfig.class,player.getSceneId());
  Map<String,MultiGroup> multiMap=mulitSceneMap.get(lastCfg.sceneSubType);
  if (multiMap != null) {
    String key=sceneService.getGroupKey(player);
    MultiGroup group=multiMap.get(key);
    if (group != null) {
      param.param=group.getHostId();
    }
  }
  return param;
}
Program: 172383
Project: 172383
Buggy source:
public PetVO toProto(){
  PetVO vo=new PetVO();
  vo.id=id;
  vo.skillId=skillID;
  vo.passiveSkillId=passiveSkillId;
  vo.hasMutate=mutateFlag;
  return vo;
}

Fixed version (ground truth):
public PetVO toProto(){
  PetVO vo=new PetVO();
  vo.id=id;
  vo.skillId=skillID;
  vo.passiveSkillId=passiveSkillId;
  vo.hasMutate=mutateFlag;
  vo.configId=configId;
  return vo;
}
Program: 172384
Project: 172384
Buggy source:
public Pet(int id,int skillID){
  this.id=id;
  this.skillID=skillID;
  this.mutateFlag=false;
}

Fixed version (ground truth):
public Pet(int id,int configId,int skillID){
  this.id=id;
  this.skillID=skillID;
  this.configId=configId;
  this.mutateFlag=false;
}
Program: 172385
Project: 172385
Buggy source:
@Override public void generatePage(Element sqlElement){
  Page page=executableElement.getAnnotation(Page.class);
  VariableElement variableElement=variableElements.get(0);
  String offset=page.offsetField();
  String limit=page.limitField();
  if (paramsAnnotated(variableElement)) {
    offset=variableElement.getSimpleName().toString() + "String_Node_Str" + offset;
    limit=variableElement.getSimpleName().toString() + "String_Node_Str" + limit;
  }
  if (page != null) {
    sqlElement.addText(String.format("String_Node_Str",offset,limit));
  }
}

Fixed version (ground truth):
@Override public void generatePage(Element sqlElement){
  Page page=executableElement.getAnnotation(Page.class);
  if (page != null) {
    VariableElement variableElement=variableElements.get(0);
    String offset=page.offsetField();
    String limit=page.limitField();
    if (paramsAnnotated(variableElement)) {
      offset=variableElement.getSimpleName().toString() + "String_Node_Str" + offset;
      limit=variableElement.getSimpleName().toString() + "String_Node_Str" + limit;
    }
    sqlElement.addText(String.format("String_Node_Str",offset,limit));
  }
}
Program: 172386
Project: 172386
Buggy source:
private void generateSet(Element updateElement){
  Element setElement=updateElement.addElement("String_Node_Str");
  VariableElement variableElement=variableElements.get(0);
  String objName="String_Node_Str";
  if (paramsAnnotated(variableElement)) {
    objName=variableElement.getSimpleName().toString() + "String_Node_Str";
  }
  if (StringUtils.isNotEmpty(update.columns())) {
    for (    String column : update.columns().split(Constants.separator)) {
      String field=tableInfo.getColumnToField().get(column);
      if (StringUtils.isNotEmpty(field)) {
        Element ifElement=setElement.addElement("String_Node_Str");
        ifElement.addAttribute("String_Node_Str",objName + field + "String_Node_Str");
        ifElement.addText(column + "String_Node_Str" + objName+ field+ "String_Node_Str");
      }
    }
    return;
  }
  for (  Map.Entry<String,String> entry : tableInfo.getFieldToColumn().entrySet()) {
    Element ifElement=setElement.addElement("String_Node_Str");
    ifElement.addAttribute("String_Node_Str",objName + entry.getKey() + "String_Node_Str");
    ifElement.addText(entry.getKey() + "String_Node_Str" + objName+ entry.getKey()+ "String_Node_Str");
  }
  tableInfo.getFieldToColumn().forEach((field,column) -> {
    Element ifElement=setElement.addElement("String_Node_Str");
    ifElement.addAttribute("String_Node_Str",field + "String_Node_Str");
    ifElement.addText(column + "String_Node_Str" + field+ "String_Node_Str");
  }
);
}

Fixed version (ground truth):
private void generateSet(Element updateElement){
  ModelCondition[] conditions=modelConditions.value();
  Set<String> fieldSet=new HashSet<>();
  for (  ModelCondition modelCondition : conditions) {
    fieldSet.add(modelCondition.field());
  }
  Element setElement=updateElement.addElement("String_Node_Str");
  VariableElement variableElement=variableElements.get(0);
  String objName="String_Node_Str";
  if (paramsAnnotated(variableElement)) {
    objName=variableElement.getSimpleName().toString() + "String_Node_Str";
  }
  if (StringUtils.isNotEmpty(update.columns())) {
    for (    String column : update.columns().split(Constants.separator)) {
      String field=tableInfo.getColumnToField().get(column);
      if (fieldSet.contains(field))       continue;
      if (StringUtils.isNotEmpty(field)) {
        Element ifElement=setElement.addElement("String_Node_Str");
        ifElement.addAttribute("String_Node_Str",objName + field + "String_Node_Str");
        ifElement.addText(column + "String_Node_Str" + objName+ field+ "String_Node_Str");
      }
    }
    return;
  }
  for (  Map.Entry<String,String> entry : tableInfo.getFieldToColumn().entrySet()) {
    if (fieldSet.contains(entry.getKey()))     continue;
    Element ifElement=setElement.addElement("String_Node_Str");
    ifElement.addAttribute("String_Node_Str",objName + entry.getKey() + "String_Node_Str");
    ifElement.addText(entry.getKey() + "String_Node_Str" + objName+ entry.getKey()+ "String_Node_Str");
  }
}
Program: 172387
Project: 172387
Buggy source:
@Override protected void checkAnnotatedRule(){
  if (executableElement.getParameters().size() != 1) {
    throw new TgDaoException(String.format("String_Node_Str",executableElement.getSimpleName().toString()));
  }
  ModelConditions modelConditions=executableElement.getAnnotation(ModelConditions.class);
  if (modelConditions != null) {
    whereSqlGen=new ModelWhereSqlGen(executableElement,tableInfo,update.sqlMode(),modelConditions);
  }
}

Fixed version (ground truth):
@Override protected void checkAnnotatedRule(){
  if (executableElement.getParameters().size() != 1) {
    throw new TgDaoException(String.format("String_Node_Str",executableElement.getSimpleName().toString()));
  }
  modelConditions=executableElement.getAnnotation(ModelConditions.class);
  if (modelConditions != null) {
    whereSqlGen=new ModelWhereSqlGen(executableElement,tableInfo,update.sqlMode(),modelConditions);
  }
}
Program: 172388
Project: 172388
Buggy source:
@Override protected void checkAnnotatedRule(){
  if (executableElement.getParameters().size() != 1) {
    throw new TgDaoException(String.format("String_Node_Str",executableElement.getSimpleName().toString()));
  }
  ModelConditions modelConditions=executableElement.getAnnotation(ModelConditions.class);
  if (modelConditions == null) {
  }
 else {
    whereSqlGen=new ModelWhereSqlGen(executableElement,tableInfo,SqlMode.COMMON,modelConditions);
  }
}

Fixed version (ground truth):
@Override protected void checkAnnotatedRule(){
  if (executableElement.getParameters().size() != 1) {
    throw new TgDaoException(String.format("String_Node_Str",executableElement.getSimpleName().toString()));
  }
  ModelConditions modelConditions=executableElement.getAnnotation(ModelConditions.class);
  if (modelConditions != null) {
    whereSqlGen=new ModelWhereSqlGen(executableElement,tableInfo,SqlMode.COMMON,modelConditions);
  }
}
Program: 172389
Project: 172389
Buggy source:
public AbstractWhereSqlGen(ExecutableElement executableElement,TableMapping tableInfo,SqlMode sqlMode){
  super(executableElement,tableInfo);
  if (sqlMode == SqlMode.SELECTIVE) {
    if (executableElement.getAnnotation(ModelCondition.class) == null && executableElement.getParameters().size() == 1) {
      whereParamSqlGen=new DirectParamSqlGen();
      return;
    }
    whereParamSqlGen=new SelectiveParamSqlGen();
  }
 else {
    whereParamSqlGen=new DirectParamSqlGen();
  }
}

Fixed version (ground truth):
public AbstractWhereSqlGen(ExecutableElement executableElement,TableMapping tableInfo,SqlMode sqlMode){
  super(executableElement,tableInfo);
  if (sqlMode == SqlMode.SELECTIVE) {
    whereParamSqlGen=new SelectiveParamSqlGen();
  }
 else {
    whereParamSqlGen=new DirectParamSqlGen();
  }
}
Program: 172390
Project: 172390
Buggy source:
@Select(columns="String_Node_Str") List<User> queryUser1(Integer age);

Fixed version (ground truth):
@Select(columns="String_Node_Str") List<User> queryUser1(@Param("String_Node_Str") Integer age);
Program: 172391
Project: 172391
Buggy source:
/** 
 * Get a LifeCycleManager by passing in a   {@link android.app.Fragment}. <p>Only used after JELLY_BEAN_MR1(api 17), as fragment after this could add child fragment</p>
 * @param fragment
 * @param initSate
 * @return
 */
@NonNull @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public static FragmentLifeCycleManager with(@NonNull android.app.Fragment fragment,InitSate initSate){
  return get().lifeCycleImpl.with(fragment,initSate);
}

Fixed version (ground truth):
/** 
 * Get a LifeCycleManager by passing in a   {@link android.app.Fragment}. <p> <p>Only used after JELLY_BEAN_MR1(api 17), as fragment after this could add child fragment</p>
 * @param fragment listened fragment, will not be retained
 * @param initSate fragment state when call this method
 * @return A LifeCycleManager to listen {@link me.ykrank.androidlifecycle.event.FragmentEvent}
 */
@NonNull @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public static FragmentLifeCycleManager with(@NonNull android.app.Fragment fragment,InitSate initSate){
  return get().lifeCycleImpl.with(fragment,initSate);
}
Program: 172392
Project: 172392
Buggy source:
static InitSate getParentState(Fragment fragment){
  InitSate initState;
  if (fragment.isResumed()) {
    initState=InitSate.RESUMED;
  }
 else   if (fragment.isVisible()) {
    initState=InitSate.BEFORE_RESUMED;
  }
 else {
    initState=InitSate.BEFORE_STARTED;
  }
  return initState;
}

Fixed version (ground truth):
static InitSate getParentState(android.app.Fragment fragment){
  InitSate initState;
  if (fragment.isResumed()) {
    initState=InitSate.RESUMED;
  }
 else   if (fragment.isVisible()) {
    initState=InitSate.BEFORE_RESUMED;
  }
 else {
    initState=InitSate.BEFORE_STARTED;
  }
  return initState;
}
Program: 172393
Project: 172393
Buggy source:
private void l(String msg){
  Log.d("String_Node_Str",msg);
}

Fixed version (ground truth):
private void l(String msg){
  if (AndroidLifeCycle.loggable() && Log.isLoggable(TAG,Log.DEBUG)) {
    Log.d(TAG,msg);
  }
}
Program: 172394
Project: 172394
Buggy source:
@Override public void onResume(){
  super.onResume();
  l("String_Node_Str");
  if (!init) {
    if (initState == InitSate.RESUMED) {
      init=true;
      return;
    }
    init=true;
  }
  if (lifeCycle != null) {
    lifeCycle.onStart();
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  l("String_Node_Str");
  if (!init) {
    if (initState == InitSate.RESUMED) {
      init=true;
      return;
    }
    init=true;
  }
  if (lifeCycle != null) {
    lifeCycle.onResume();
  }
}
Program: 172395
Project: 172395
Buggy source:
private void l(String msg){
  Log.d("String_Node_Str",msg);
}

Fixed version (ground truth):
private void l(String msg){
  if (AndroidLifeCycle.loggable() && Log.isLoggable(TAG,Log.DEBUG)) {
    Log.d(TAG,msg);
  }
}
Program: 172396
Project: 172396
Buggy source:
@Override public void onResume(){
  super.onResume();
  l("String_Node_Str");
  if (!init) {
    if (initState == InitSate.RESUMED) {
      init=true;
      return;
    }
    init=true;
  }
  if (lifeCycle != null) {
    lifeCycle.onStart();
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  l("String_Node_Str");
  if (!init) {
    if (initState == InitSate.RESUMED) {
      init=true;
      return;
    }
    init=true;
  }
  if (lifeCycle != null) {
    lifeCycle.onResume();
  }
}
Program: 172399
Project: 172399
Buggy source:
public ChatInteractor(ChatContract.OnSendMessageListener onSendMessageListener,ChatContract.OnGetMessagesListener onGetMessagesListener){
  this.mOnSendMessageListener=onSendMessageListener;
  this.mOnGetMessagesListener=onGetMessagesListener;
}

Fixed version (ground truth):
ChatInteractor(ChatContract.OnSendMessageListener onSendMessageListener,ChatContract.OnGetMessagesListener onGetMessagesListener){
  this.mOnSendMessageListener=onSendMessageListener;
  this.mOnGetMessagesListener=onGetMessagesListener;
}
Program: 172400
Project: 172400
Buggy source:
private void configureMyChatViewHolder(final MyChatViewHolder myChatViewHolder,int position){
  final Chat chat=mChats.get(position);
  myChatViewHolder.txtChatMessage.setText(chat.getMessage());
  FirebaseStorage storage=FirebaseStorage.getInstance();
  StorageReference storageRef=storage.getReferenceFromUrl(String.valueOf(R.string.storage_link));
  storageRef.child("String_Node_Str" + chat.getSender() + "String_Node_Str").getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>(){
    @Override public void onSuccess(    Uri uri){
      try {
        Glide.with(myChatViewHolder.imgViewUser.getContext()).load("String_Node_Str" + uri.toString()).diskCacheStrategy(DiskCacheStrategy.ALL).into(myChatViewHolder.imgViewUser);
      }
 catch (      Exception e) {
      }
    }
  }
);
  myChatViewHolder.imgViewUser.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(myChatViewHolder.imgViewUser.getContext(),ProfileActivity.class);
      Bundle b=new Bundle();
      b.putString("String_Node_Str",chat.getSender());
      intent.putExtras(b);
      myChatViewHolder.imgViewUser.getContext().startActivity(intent);
    }
  }
);
}

Fixed version (ground truth):
private void configureMyChatViewHolder(final MyChatViewHolder myChatViewHolder,int position){
  final Chat chat=mChats.get(position);
  myChatViewHolder.txtChatMessage.setText(chat.getMessage());
  FirebaseStorage storage=FirebaseStorage.getInstance();
  StorageReference storageRef=storage.getReferenceFromUrl(context.getResources().getString(R.string.storage_link));
  storageRef.child("String_Node_Str" + chat.getSender() + "String_Node_Str").getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>(){
    @Override public void onSuccess(    Uri uri){
      try {
        Glide.with(myChatViewHolder.imgViewUser.getContext()).load("String_Node_Str" + uri.toString()).diskCacheStrategy(DiskCacheStrategy.ALL).into(myChatViewHolder.imgViewUser);
      }
 catch (      Exception e) {
      }
    }
  }
);
  myChatViewHolder.imgViewUser.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(myChatViewHolder.imgViewUser.getContext(),ProfileActivity.class);
      Bundle b=new Bundle();
      b.putString("String_Node_Str",chat.getSender());
      intent.putExtras(b);
      myChatViewHolder.imgViewUser.getContext().startActivity(intent);
    }
  }
);
}
Program: 172402
Project: 172402
Buggy source:
@Override public void run(){
  ReactInstanceManager reactInstanceManager;
  try {
    reactInstanceManager=ReactInstanceManager.builder().setApplication(instrumentation.newApplication(MyTestApplication.class.getClassLoader(),MyTestApplication.class.getName(),getInstrumentation().getContext())).setBundleAssetName("String_Node_Str").setJSMainModuleName("String_Node_Str").addPackage(new MainReactPackage()).setUseDeveloperSupport(false).setInitialLifecycleState(LifecycleState.BEFORE_CREATE).addPackage(mockElectrodePackage).build();
    reactInstanceManager.createReactContextInBackground();
    reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener(){
      @Override public void onReactContextInitialized(      ReactContext context){
        mockElectrodePackage.onReactNativeInitialized();
        countDownLatch.countDown();
      }
    }
);
  }
 catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  ReactInstanceManager reactInstanceManager;
  try {
    reactInstanceManager=ReactInstanceManager.builder().setApplication(instrumentation.newApplication(MyTestApplication.class.getClassLoader(),MyTestApplication.class.getName(),getInstrumentation().getContext())).setBundleAssetName("String_Node_Str").addPackage(new MainReactPackage()).setUseDeveloperSupport(false).setInitialLifecycleState(LifecycleState.BEFORE_CREATE).addPackage(mockElectrodePackage).build();
    reactInstanceManager.createReactContextInBackground();
    reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener(){
      @Override public void onReactContextInitialized(      ReactContext context){
        mockElectrodePackage.onReactNativeInitialized();
        countDownLatch.countDown();
      }
    }
);
  }
 catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
}
Program: 172403
Project: 172403
Buggy source:
private void initBridge(){
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  final ElectrodeBridgePackage mockElectrodePackage=new MockElectrodePackage();
  final Instrumentation instrumentation=this.getInstrumentation();
  runOnUiThread(new Runnable(){
    @Override public void run(){
      ReactInstanceManager reactInstanceManager;
      try {
        reactInstanceManager=ReactInstanceManager.builder().setApplication(instrumentation.newApplication(MyTestApplication.class.getClassLoader(),MyTestApplication.class.getName(),getInstrumentation().getContext())).setBundleAssetName("String_Node_Str").setJSMainModuleName("String_Node_Str").addPackage(new MainReactPackage()).setUseDeveloperSupport(false).setInitialLifecycleState(LifecycleState.BEFORE_CREATE).addPackage(mockElectrodePackage).build();
        reactInstanceManager.createReactContextInBackground();
        reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener(){
          @Override public void onReactContextInitialized(          ReactContext context){
            mockElectrodePackage.onReactNativeInitialized();
            countDownLatch.countDown();
          }
        }
);
      }
 catch (      InstantiationException e) {
        e.printStackTrace();
      }
catch (      IllegalAccessException e) {
        e.printStackTrace();
      }
catch (      ClassNotFoundException e) {
        e.printStackTrace();
      }
    }
  }
);
  waitForCountDownToFinishOrFail(countDownLatch);
}

Fixed version (ground truth):
private void initBridge(){
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  final ElectrodeBridgePackage mockElectrodePackage=new MockElectrodePackage();
  final Instrumentation instrumentation=this.getInstrumentation();
  runOnUiThread(new Runnable(){
    @Override public void run(){
      ReactInstanceManager reactInstanceManager;
      try {
        reactInstanceManager=ReactInstanceManager.builder().setApplication(instrumentation.newApplication(MyTestApplication.class.getClassLoader(),MyTestApplication.class.getName(),getInstrumentation().getContext())).setBundleAssetName("String_Node_Str").addPackage(new MainReactPackage()).setUseDeveloperSupport(false).setInitialLifecycleState(LifecycleState.BEFORE_CREATE).addPackage(mockElectrodePackage).build();
        reactInstanceManager.createReactContextInBackground();
        reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener(){
          @Override public void onReactContextInitialized(          ReactContext context){
            mockElectrodePackage.onReactNativeInitialized();
            countDownLatch.countDown();
          }
        }
);
      }
 catch (      InstantiationException e) {
        e.printStackTrace();
      }
catch (      IllegalAccessException e) {
        e.printStackTrace();
      }
catch (      ClassNotFoundException e) {
        e.printStackTrace();
      }
    }
  }
);
  waitForCountDownToFinishOrFail(countDownLatch);
}
Program: 172404
Project: 172404
Buggy source:
/** 
 * Method for testing only
 */
@VisibleForTesting void debug_ClearRequestHandlerRegistrar(){
  ((RequestRegistrarImpl)mRequestRegistrar).reset();
}

Fixed version (ground truth):
/** 
 * Method for testing only
 */
@VisibleForTesting void debug_ClearRequestHandlerRegistrar(){
  ((RequestRegistrarImpl)sRequestRegistrar).reset();
}
Program: 172405
Project: 172405
Buggy source:
/** 
 * Initializes a new instance of ElectrodeBridgeTransceiver
 * @param reactContextWrapper The react application context
 */
private ElectrodeBridgeTransceiver(@NonNull ReactContextWrapper reactContextWrapper){
  super(reactContextWrapper.getContext());
  mReactContextWrapper=reactContextWrapper;
  mEventDispatcher=new EventDispatcherImpl(mEventRegistrar);
  mRequestDispatcher=new RequestDispatcherImpl(mRequestRegistrar);
}

Fixed version (ground truth):
/** 
 * Initializes a new instance of ElectrodeBridgeTransceiver
 * @param reactContextWrapper The react application context
 */
private ElectrodeBridgeTransceiver(@NonNull ReactContextWrapper reactContextWrapper){
  super(reactContextWrapper.getContext());
  mReactContextWrapper=reactContextWrapper;
}
Program: 172406
Project: 172406
Buggy source:
/** 
 * Creates the ElectrodeBridgeTransceiver singleton
 * @param reactContextWrapper {@link ReactContextWrapper}
 * @return The singleton instance of ElectrodeBridgeTransceiver
 */
@VisibleForTesting static ElectrodeBridgeTransceiver create(@NonNull ReactContextWrapper reactContextWrapper){
  Logger.d(TAG,"String_Node_Str");
synchronized (ElectrodeBridgeTransceiver.class) {
    if (sInstance == null) {
      sInstance=new ElectrodeBridgeTransceiver(reactContextWrapper);
    }
  }
  return sInstance;
}

Fixed version (ground truth):
/** 
 * Creates the ElectrodeBridgeTransceiver singleton
 * @param reactContextWrapper {@link ReactContextWrapper}
 * @return The singleton instance of ElectrodeBridgeTransceiver
 */
@VisibleForTesting static ElectrodeBridgeTransceiver create(@NonNull ReactContextWrapper reactContextWrapper){
  Logger.d(TAG,"String_Node_Str");
  sInstance=new ElectrodeBridgeTransceiver(reactContextWrapper);
  return sInstance;
}
Program: 172407
Project: 172407
Buggy source:
@Override public void registerRequestHandler(@NonNull String name,@NonNull ElectrodeBridgeRequestHandler<ElectrodeBridgeRequest,Object> requestHandler){
  mRequestRegistrar.registerRequestHandler(name,requestHandler);
}

Fixed version (ground truth):
@Override public void registerRequestHandler(@NonNull String name,@NonNull ElectrodeBridgeRequestHandler<ElectrodeBridgeRequest,Object> requestHandler){
  sRequestRegistrar.registerRequestHandler(name,requestHandler);
}
Program: 172408
Project: 172408
Buggy source:
private void notifyLocalEventListeners(@NonNull final ElectrodeBridgeEvent event){
  mReactContextWrapper.runOnUiQueueThread(new Runnable(){
    @Override public void run(){
      mEventDispatcher.dispatchEvent(event);
    }
  }
);
}

Fixed version (ground truth):
private void notifyLocalEventListeners(@NonNull final ElectrodeBridgeEvent event){
  mReactContextWrapper.runOnUiQueueThread(new Runnable(){
    @Override public void run(){
      sEventDispatcher.dispatchEvent(event);
    }
  }
);
}
Program: 172409
Project: 172409
Buggy source:
private void dispatchRequestToLocalHandler(@NonNull final BridgeTransaction transaction){
  Logger.d(TAG,"String_Node_Str",transaction.getRequest().getId());
  final ElectrodeBridgeRequest request=transaction.getRequest();
  mRequestDispatcher.dispatchRequest(transaction.getRequest(),new ElectrodeBridgeResponseListener<Object>(){
    @Override public void onFailure(    @NonNull FailureMessage failureMessage){
      ElectrodeBridgeResponse response=ElectrodeBridgeResponse.createResponseForRequest(request,null,failureMessage);
      handleResponse(response);
    }
    @Override public void onSuccess(    @Nullable Object responseData){
      ElectrodeBridgeResponse response=ElectrodeBridgeResponse.createResponseForRequest(request,responseData,null);
      handleResponse(response);
    }
  }
);
}

Fixed version (ground truth):
private void dispatchRequestToLocalHandler(@NonNull final BridgeTransaction transaction){
  Logger.d(TAG,"String_Node_Str",transaction.getRequest().getId());
  final ElectrodeBridgeRequest request=transaction.getRequest();
  sRequestDispatcher.dispatchRequest(transaction.getRequest(),new ElectrodeBridgeResponseListener<Object>(){
    @Override public void onFailure(    @NonNull FailureMessage failureMessage){
      ElectrodeBridgeResponse response=ElectrodeBridgeResponse.createResponseForRequest(request,null,failureMessage);
      handleResponse(response);
    }
    @Override public void onSuccess(    @Nullable Object responseData){
      ElectrodeBridgeResponse response=ElectrodeBridgeResponse.createResponseForRequest(request,responseData,null);
      handleResponse(response);
    }
  }
);
}
Program: 172410
Project: 172410
Buggy source:
private void handleRequest(@NonNull final ElectrodeBridgeRequest request,@Nullable ElectrodeBridgeResponseListener<ElectrodeBridgeResponse> responseListener){
  logRequest(request);
  if (responseListener == null && !request.isJsInitiated()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final BridgeTransaction bridgeTransaction=createTransaction(request,responseListener);
  if (mRequestDispatcher.canHandleRequest(request.getName())) {
    dispatchRequestToLocalHandler(bridgeTransaction);
  }
 else   if (!request.isJsInitiated()) {
    dispatchRequestToReact(bridgeTransaction);
  }
 else {
    Logger.d(TAG,"String_Node_Str",request.getId(),request.getName());
    handleResponse(ElectrodeBridgeResponse.createResponseForRequest(request,null,BridgeFailureMessage.create("String_Node_Str","String_Node_Str" + request.getName())));
  }
}

Fixed version (ground truth):
private void handleRequest(@NonNull final ElectrodeBridgeRequest request,@Nullable ElectrodeBridgeResponseListener<ElectrodeBridgeResponse> responseListener){
  logRequest(request);
  if (responseListener == null && !request.isJsInitiated()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final BridgeTransaction bridgeTransaction=createTransaction(request,responseListener);
  if (sRequestDispatcher.canHandleRequest(request.getName())) {
    dispatchRequestToLocalHandler(bridgeTransaction);
  }
 else   if (!request.isJsInitiated()) {
    dispatchRequestToReact(bridgeTransaction);
  }
 else {
    Logger.d(TAG,"String_Node_Str",request.getId(),request.getName());
    handleResponse(ElectrodeBridgeResponse.createResponseForRequest(request,null,BridgeFailureMessage.create("String_Node_Str","String_Node_Str" + request.getName())));
  }
}
Program: 172411
Project: 172411
Buggy source:
@NonNull private BridgeTransaction createTransaction(@NonNull ElectrodeBridgeRequest request,@Nullable ElectrodeBridgeResponseListener<ElectrodeBridgeResponse> responseListener){
  final BridgeTransaction bridgeTransaction=new BridgeTransaction(request,responseListener);
  pendingTransactions.put(request.getId(),bridgeTransaction);
  startTimeOutCheckForTransaction(bridgeTransaction);
  return bridgeTransaction;
}

Fixed version (ground truth):
@NonNull private BridgeTransaction createTransaction(@NonNull ElectrodeBridgeRequest request,@Nullable ElectrodeBridgeResponseListener<ElectrodeBridgeResponse> responseListener){
  final BridgeTransaction bridgeTransaction=new BridgeTransaction(request,responseListener);
  sPendingTransactions.put(request.getId(),bridgeTransaction);
  startTimeOutCheckForTransaction(bridgeTransaction);
  return bridgeTransaction;
}
Program: 172412
Project: 172412
Buggy source:
private void handleResponse(@NonNull ElectrodeBridgeResponse bridgeResponse){
  Logger.d(TAG,"String_Node_Str");
  BridgeTransaction transaction=pendingTransactions.get(bridgeResponse.getId());
  if (transaction != null) {
    transaction.setResponse(bridgeResponse);
    completeTransaction(transaction);
  }
 else {
    Logger.i(TAG,"String_Node_Str",bridgeResponse.getId(),bridgeResponse.getName());
  }
}

Fixed version (ground truth):
private void handleResponse(@NonNull ElectrodeBridgeResponse bridgeResponse){
  Logger.d(TAG,"String_Node_Str");
  BridgeTransaction transaction=sPendingTransactions.get(bridgeResponse.getId());
  if (transaction != null) {
    transaction.setResponse(bridgeResponse);
    completeTransaction(transaction);
  }
 else {
    Logger.i(TAG,"String_Node_Str",bridgeResponse.getId(),bridgeResponse.getName());
  }
}