nus-yam/ex-repair huggingface dataset:
Program: 72240
Project: 72240
Buggy source:
private void elemAccount(){
  int elemNum=0;
  for (int i=0; i < playerNum; i++) {
    if (map.units[allPlayers[i].preLoc].status == 2) {
      allPlayers[i].hasElem=true;
      elementList[i]=1;
      for (int j=0; j < playerNum; j++) {
        if (elementList[j] == 1)         elemNum+=1;
      }
    }
  }
}

Fixed version (ground truth):
private void elemAccount(){
  int elemNum=0;
  if (accountNum == 0) {
    for (int i=0; i < playerNum; i++) {
      if (map.units[allPlayers[i].preLoc].status == 2) {
        allPlayers[i].hasElem=true;
        elementList[i]=1;
        for (int j=0; j < playerNum; j++) {
          if (elementList[j] == 1)           elemNum+=1;
        }
      }
    }
  }
  accountNum+=1;
}
Program: 72241
Project: 72241
Buggy source:
private void infectionAccount(){
  for (int i=0; i < playerNum; i++) {
    for (int j=0; j < playerNum; j++) {
      PlayerChecker.infection(map,allPlayers[i],allPlayers[j]);
      if (PlayerChecker.infection(map,allPlayers[i],allPlayers[j]))       scoreList[i]+=25;
    }
  }
  for (int i=0; i < playerNum; i++)   teamList[i]=allPlayers[i].team;
  Boolean flag=true;
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].team == Player.HUMAN)     flag=false;
  }
  if (flag)   zombieWin=true;
}

Fixed version (ground truth):
private void infectionAccount(){
  for (int i=0; i < playerNum; i++) {
    for (int j=0; j < playerNum; j++) {
      PlayerChecker.infection(map,allPlayers[i],allPlayers[j]);
    }
  }
  for (int i=0; i < playerNum; i++)   teamList[i]=allPlayers[i].team;
  Boolean flag=true;
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].team == Player.HUMAN)     flag=false;
  }
  if (flag)   zombieWin=true;
}
Program: 72242
Project: 72242
Buggy source:
private void winJudge(){
synchronized (this) {
    gamble_count+=1;
    if (gamble_count < playerNum) {
      while (gamble_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      GambleChecker.winJudge(playerNum,allPlayers);
      for (int i=0; i < playerNum; i++) {
        if (allPlayers[i].isWin)         scoreList[i]+=5;
 else         scoreList[i]-=5;
      }
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void winJudge(){
synchronized (this) {
    gamble_count+=1;
    if (gamble_count < playerNum) {
      while (gamble_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      GambleChecker.winJudge(playerNum,allPlayers);
      this.notifyAll();
    }
  }
}
Program: 72243
Project: 72243
Buggy source:
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  map=new Map("String_Node_Str");
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  decisionChoices=new int[playerNum];
  seenCardChoices=new int[playerNum];
  cardHeap=new int[40 * playerNum];
  gambleChoices=new int[playerNum];
  cardNumList=new int[playerNum];
  playerWinList=new int[playerNum];
  energyList=new int[playerNum];
  healthPointList=new int[playerNum];
  locationList=new int[playerNum];
  elementList=new int[playerNum];
  teamList=new int[playerNum];
  availableFireTarget=new int[playerNum];
  scoreList=new int[playerNum];
  availableMoveDirection=new int[8];
  fireList=new int[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].healthPoint=6;
    allPlayers[i].mot=4;
    allPlayers[i].handCards=new int[allPlayers[i].healthPoint + 4];
    allPlayers[i].fireTarget=-1;
    allPlayers[i].moveDirection=-1;
    playerState[i]=0;
    scoreList[i]=100;
    fireList[i]=-1;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}

Fixed version (ground truth):
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  map=new Map("String_Node_Str");
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  decisionChoices=new int[playerNum];
  seenCardChoices=new int[playerNum];
  cardHeap=new int[40 * playerNum];
  gambleChoices=new int[playerNum];
  cardNumList=new int[playerNum];
  playerWinList=new int[playerNum];
  energyList=new int[playerNum];
  healthPointList=new int[playerNum];
  locationList=new int[playerNum];
  elementList=new int[playerNum];
  teamList=new int[playerNum];
  availableFireTarget=new int[playerNum];
  scoreList=new int[playerNum];
  availableMoveDirection=new int[8];
  fireList=new int[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].healthPoint=6;
    allPlayers[i].mot=4;
    allPlayers[i].energy=0;
    allPlayers[i].handCards=new int[allPlayers[i].healthPoint + 4];
    allPlayers[i].fireTarget=-1;
    allPlayers[i].moveDirection=-1;
    playerState[i]=0;
    scoreList[i]=100;
    fireList[i]=-1;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}
Program: 72244
Project: 72244
Buggy source:
private void fireAccount(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].stratDecision == GambleChecker.FIRE)     PlayerChecker.fire(map,allPlayers[i],allPlayers[allPlayers[i].fireTarget]);
    healthPointList[i]=allPlayers[i].healthPoint;
  }
}

Fixed version (ground truth):
private void fireAccount(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].stratDecision == GambleChecker.FIRE) {
      if (allPlayers[i].fireTarget == -1)       break;
      PlayerChecker.fire(map,allPlayers[i],allPlayers[allPlayers[i].fireTarget]);
    }
    healthPointList[i]=allPlayers[i].healthPoint;
  }
}
Program: 72245
Project: 72245
Buggy source:
private void elemAccount(){
  int elemNum=0;
  for (int i=0; i < playerNum; i++) {
    if (map.units[allPlayers[i].preLoc].status == 2) {
      allPlayers[i].hasElem=true;
      elementList[i]=1;
      for (int j=0; j < playerNum; j++) {
        if (elementList[j] == 1)         elemNum+=1;
      }
      scoreList[i]+=elemNum * 25;
    }
  }
}

Fixed version (ground truth):
private void elemAccount(){
  int elemNum=0;
  for (int i=0; i < playerNum; i++) {
    if (map.units[allPlayers[i].preLoc].status == 2) {
      allPlayers[i].hasElem=true;
      elementList[i]=1;
      for (int j=0; j < playerNum; j++) {
        if (elementList[j] == 1)         elemNum+=1;
      }
    }
  }
}
Program: 72246
Project: 72246
Buggy source:
private void moveAccount(){
  for (int i=0; i < playerNum; i++) {
    if (decisionChoices[i] == GambleChecker.MOVE)     allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
    locationList[i]=allPlayers[i].preLoc;
  }
}

Fixed version (ground truth):
private void moveAccount(){
  for (int i=0; i < playerNum; i++) {
    if (decisionChoices[i] == GambleChecker.MOVE) {
      if (allPlayers[i].moveDirection == -1)       break;
      allPlayers[i].preLoc=MapChecker.tryMove(map,allPlayers[i].preLoc,allPlayers[i].moveDirection,allPlayers[i].energyConsume);
    }
    locationList[i]=allPlayers[i].preLoc;
  }
}
Program: 72250
Project: 72250
Buggy source:
Map(String filename){
  try {
    FileInputStream fileInput=new FileInputStream(filename);
    ObjectInputStream ois=new ObjectInputStream(fileInput);
    int number=ois.readInt();
    fighter_init=ois.readInt();
    poisoner_init=ois.readInt();
    fighter_evacuate=ois.readInt();
    units=new MapUnit[number];
    for (int i=0; fileInput.available() > 0; i++) {
      try {
        units[i]=(MapUnit)ois.readObject();
      }
 catch (      ClassNotFoundException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IOException i) {
    i.printStackTrace();
  }
}

Fixed version (ground truth):
Map(String filename){
  try {
    FileInputStream fileInput=new FileInputStream(filename);
    ObjectInputStream ois=new ObjectInputStream(fileInput);
    int number=ois.readInt();
    fighter_init=ois.readInt();
    poisoner_init=ois.readInt();
    fighter_evacuate=ois.readInt();
    units=new MapUnit[number];
    for (int i=0; fileInput.available() > 0; i++) {
      try {
        units[i]=(MapUnit)ois.readObject();
      }
 catch (      ClassNotFoundException e) {
        e.printStackTrace();
      }
    }
    distance=new int[number][number];
    floyd();
  }
 catch (  IOException i) {
    i.printStackTrace();
  }
}
Program: 72251
Project: 72251
Buggy source:
static void fire(Map map,Player playerPos,Player playerPas){
  distance=MapChecker.distance(map.units[playerPas.preLoc],map.units[playerPos.preLoc]);
  if (playerPos.range >= distance) {
    if (playerPas.healthPoint - playerPos.energyConsume > 4)     playerPas.healthPoint-=playerPos.energyConsume;
 else     playerPas.healthPoint=4;
  }
}

Fixed version (ground truth):
static void fire(Map map,Player playerPos,Player playerPas){
  distance=map.distance[playerPas.preLoc][playerPos.preLoc];
  if (playerPos.range >= distance) {
    if (playerPas.healthPoint - playerPos.energyConsume > 4)     playerPas.healthPoint-=playerPos.energyConsume;
 else     playerPas.healthPoint=4;
  }
}
Program: 72252
Project: 72252
Buggy source:
public static int tryMove(Map m,int i_current,int i_next,int energy){
}

Fixed version (ground truth):
static int tryMove(Map m,int i_current,int i_next,int energy){
}
Program: 72253
Project: 72253
Buggy source:
static void map1_test(){
  Map X=new Map("String_Node_Str");
  assert(X.units[7].edge[2].adjedg == 22);
  assert(X.units[10].rank == 3);
  assert(MapChecker.outDistance(X.units[3],X.units[8]) == -1);
}

Fixed version (ground truth):
static void map1_test(){
  Map X=new Map("String_Node_Str");
  assert(X.units[7].edge[2].adjedg == 22);
  assert(X.units[10].rank == 3);
}
Program: 72254
Project: 72254
Buggy source:
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  map=new Map("String_Node_Str");
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  decisionChoices=new int[playerNum];
  seenCardChoices=new int[playerNum];
  cardHeap=new int[40 * playerNum];
  gambleChoices=new int[playerNum];
  cardNumList=new int[playerNum];
  playerWinList=new int[playerNum];
  energyList=new int[playerNum];
  healthPointList=new int[playerNum];
  locationList=new int[playerNum];
  elementList=new int[playerNum];
  teamList=new int[playerNum];
  availableFireTarget=new int[playerNum];
  scoreList=new int[playerNum];
  availableMoveDirection=new int[8];
  fireList=new int[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].healthPoint=6;
    allPlayers[i].mot=4;
    allPlayers[i].handCards=new int[allPlayers[i].healthPoint + 4];
    playerState[i]=0;
    scoreList[i]=100;
    fireList[i]=-1;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}

Fixed version (ground truth):
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  map=new Map("String_Node_Str");
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  decisionChoices=new int[playerNum];
  seenCardChoices=new int[playerNum];
  cardHeap=new int[40 * playerNum];
  gambleChoices=new int[playerNum];
  cardNumList=new int[playerNum];
  playerWinList=new int[playerNum];
  energyList=new int[playerNum];
  healthPointList=new int[playerNum];
  locationList=new int[playerNum];
  elementList=new int[playerNum];
  teamList=new int[playerNum];
  availableFireTarget=new int[playerNum];
  scoreList=new int[playerNum];
  availableMoveDirection=new int[8];
  fireList=new int[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].healthPoint=6;
    allPlayers[i].mot=4;
    allPlayers[i].handCards=new int[allPlayers[i].healthPoint + 4];
    allPlayers[i].fireTarget=-1;
    allPlayers[i].moveDirection=-1;
    playerState[i]=0;
    scoreList[i]=100;
    fireList[i]=-1;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}
Program: 72256
Project: 72256
Buggy source:
private void teamDivide(){
  int zombie=(int)(Math.random() * playerNum);
  allPlayers[zombie].team=Player.ZOMBIE;
  teamResult[zombie]=Player.ZOMBIE;
  for (int i=0; i < allPlayers.length; i++) {
    if (i != zombie) {
      allPlayers[i].team=Player.HUMAN;
      teamResult[i]=Player.HUMAN;
    }
  }
}

Fixed version (ground truth):
private void teamDivide(){
  int zombie=(int)(Math.random() * playerNum);
  allPlayers[zombie].team=Player.ZOMBIE;
  allPlayers[zombie].energy=0;
  allPlayers[zombie].hasElem=false;
  allPlayers[zombie].firePow=0;
  allPlayers[zombie].range=0;
  teamResult[zombie]=Player.ZOMBIE;
  for (int i=0; i < allPlayers.length; i++) {
    if (i != zombie) {
      allPlayers[i].team=Player.HUMAN;
      teamResult[i]=Player.HUMAN;
    }
  }
}
Program: 72257
Project: 72257
Buggy source:
static Boolean infection(Map map,Player playerPos,Player playerPas){
  if (playerPos.preLoc == playerPas.preLoc) {
    if (map.units[playerPos.preLoc].status == 1) {
      if (playerPos.team == Player.ZOMBIE & playerPas.team == Player.HUMAN) {
        playerPas.team=Player.ZOMBIE;
        playerPas.energy=0;
        playerPas.hasElem=false;
        playerPas.firePow=0;
        playerPas.range=0;
        playerPas.healthPoint=0;
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
static Boolean infection(Map map,Player playerPos,Player playerPas){
  if (playerPos.preLoc == playerPas.preLoc) {
    if (map.units[playerPos.preLoc].status == 1) {
      if (playerPos.team == Player.ZOMBIE & playerPas.team == Player.HUMAN) {
        playerPas.team=Player.ZOMBIE;
        playerPas.energy=0;
        playerPas.hasElem=false;
        playerPas.firePow=0;
        playerPas.range=0;
        return true;
      }
    }
  }
  return false;
}
Program: 72258
Project: 72258
Buggy source:
static void winJudge(int playerNum,Player[] players){
  for (int i=0; i < playerNum; i++) {
    for (int j=0; j < playerNum; j++) {
      if (i == j)       continue;
      if (players[i].team == players[j].team)       continue;
      players[i].isWin=win(players[i],players[j]);
      if (players[i].isWin) {
        if (players[i].energy + players[i].gambleNum < players[i].healthPoint)         players[i].energy+=players[i].gambleNum;
 else         players[i].energy=players[i].healthPoint;
        break;
      }
    }
  }
}

Fixed version (ground truth):
static void winJudge(int playerNum,Player[] players){
  for (int i=0; i < playerNum; i++) {
    for (int j=0; j < playerNum; j++) {
      if (i == j)       continue;
      if (players[i].team == players[j].team)       continue;
      players[i].isWin=win(players[i],players[j]);
    }
  }
}
Program: 72260
Project: 72260
Buggy source:
private void featureChoose(String msg,Player playerMain){
  MsgDecisionFeature decisionFeature=GodHelper.getDecisionFeature(msg);
  int decision=playerMain.stratDecision;
  if (decision == GambleChecker.MOVE)   playerMain.moveDirection=decisionFeature.moveDirection();
 else   if (decision == GambleChecker.FIRE)   playerMain.fireTarget=decisionFeature.fireTarget();
}

Fixed version (ground truth):
private void featureChoose(String msg,Player playerMain){
  MsgDecisionFeature decisionFeature=GodHelper.getDecisionFeature(msg);
  int decision=playerMain.stratDecision;
  if (decision == GambleChecker.MOVE) {
    playerMain.moveDirection=decisionFeature.moveDirection();
    playerMain.energyConsume=Math.min(playerMain.energy,playerMain.mot);
  }
 else   if (decision == GambleChecker.FIRE) {
    playerMain.fireTarget=decisionFeature.fireTarget();
    playerMain.energyConsume=Math.min(playerMain.energy,playerMain.firePow);
  }
 else   if (decision == GambleChecker.DEPOSIT) {
    playerMain.energyConsume=0;
  }
}
Program: 72261
Project: 72261
Buggy source:
private void mapInit(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].team == Player.HUMAN)     allPlayers[i].preLoc=map.units[4];
 else     if (allPlayers[i].team == Player.ZOMBIE)     allPlayers[i].preLoc=map.units[0];
  }
}

Fixed version (ground truth):
private void mapInit(){
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].team == Player.HUMAN)     allPlayers[i].preLoc=map.fighter_init;
 else     if (allPlayers[i].team == Player.ZOMBIE)     allPlayers[i].preLoc=map.poisoner_init;
  }
}
Program: 72262
Project: 72262
Buggy source:
private void seenCard(int playerIndex,String msg,Player playerMain){
  MsgSeenCard msgSeenCard=GodHelper.getSeenCard(msg);
synchronized (this) {
    seen_card_count+=1;
    if ((playerMain.isSeenCard) | (msgSeenCard.seenCard() != 0)) {
      playerMain.gamble=msgSeenCard.seenCard();
      playerMain.isSeenCard=true;
      seenCardChoices[playerIndex]=1;
    }
    if (seen_card_count < playerNum) {
      while (seen_card_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void seenCard(int playerIndex,String msg,Player playerMain){
  MsgSeenCard msgSeenCard=GodHelper.getSeenCard(msg);
synchronized (this) {
    seen_card_count+=1;
    if ((playerMain.isSeenCard) | (msgSeenCard.seenCard() != 0)) {
      playerMain.gamble=msgSeenCard.seenCard();
      playerMain.isSeenCard=true;
      seenCardChoices[playerIndex]=msgSeenCard.seenCard();
    }
    if (seen_card_count < playerNum) {
      while (seen_card_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      this.notifyAll();
    }
  }
}
Program: 72263
Project: 72263
Buggy source:
void infection(Player playerPos,Player playerPas){
  if (playerPos.preLoc == playerPas.preLoc) {
    if (playerPos.preLoc.status == 1) {
      if (playerPos.team == Player.ZOMBIE & playerPas.team == Player.HUMAN) {
        playerPas.team=Player.ZOMBIE;
        playerPas.energy=0;
        playerPas.hasElem=false;
        playerPas.firePow=0;
        playerPas.range=0;
        playerPas.healthPoint=0;
      }
    }
  }
}

Fixed version (ground truth):
static Boolean infection(Map map,Player playerPos,Player playerPas){
  if (playerPos.preLoc == playerPas.preLoc) {
    if (map.units[playerPos.preLoc].status == 1) {
      if (playerPos.team == Player.ZOMBIE & playerPas.team == Player.HUMAN) {
        playerPas.team=Player.ZOMBIE;
        playerPas.energy=0;
        playerPas.hasElem=false;
        playerPas.firePow=0;
        playerPas.range=0;
        playerPas.healthPoint=0;
        return true;
      }
    }
  }
  return false;
}
Program: 72264
Project: 72264
Buggy source:
static void energyAcq(Player playerMain,int energyVal){
  if (playerMain.energy < playerMain.healthPoint)   playerMain.energy+=energyVal;
}

Fixed version (ground truth):
static void energyAcq(Player playerMain,int energyVal){
  playerMain.energy+=energyVal;
}
Program: 72265
Project: 72265
Buggy source:
static void fire(Player playerPos,Player playerPas,MapEdge direction){
  distance=myMap.outDistance(playerPas.preLoc,playerPos.preLoc);
  if (playerPos.range >= distance) {
    playerPas.healthPoint-=playerPos.firePow;
  }
}

Fixed version (ground truth):
static void fire(Map map,Player playerPos,Player playerPas){
  distance=MapChecker.outDistance(map.units[playerPas.preLoc],map.units[playerPos.preLoc]);
  if (playerPos.range >= distance) {
    if (playerPas.healthPoint - playerPos.energyConsume > 4)     playerPas.healthPoint-=playerPos.energyConsume;
 else     playerPas.healthPoint=4;
  }
}
Program: 72267
Project: 72267
Buggy source:
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  map=new Map("String_Node_Str");
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  cardHeap=new int[40 * playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].handCards=new int[allPlayers[i].healthPoint + 4];
    allPlayers[i].cardsDesertNum=0;
    allPlayers[i].cardsDesertList=new int[4];
    playerState[i]=0;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}

Fixed version (ground truth):
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  map=new Map("String_Node_Str");
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  decisionChoices=new int[playerNum];
  seenCardChoices=new int[playerNum];
  cardHeap=new int[40 * playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].handCards=new int[allPlayers[i].healthPoint + 4];
    allPlayers[i].cardsDesertNum=0;
    allPlayers[i].cardsDesertList=new int[4];
    playerState[i]=0;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}
Program: 72268
Project: 72268
Buggy source:
static int[] cardHeapInit(int[] cardHeap,int playerNum){
  int i, j;
  cardHeap=new int[40 * playerNum];
  for (i=0; i < 8 * playerNum; i++) {
    cardHeap[i]=FIRE;
  }
  j=i;
  for (; i < j + 12 * playerNum; i++) {
    cardHeap[i]=MOVE;
  }
  j=i;
  for (; i < j + 8 * playerNum; i++) {
    cardHeap[i]=SKILLS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=PAPER;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=SCISSORS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=STONE;
  }
  return cardHeap;
}

Fixed version (ground truth):
static int[] cardHeapInit(int[] cardHeap,int playerNum){
  int i, j;
  for (i=0; i < 8 * playerNum; i++) {
    cardHeap[i]=FIRE;
  }
  j=i;
  for (; i < j + 12 * playerNum; i++) {
    cardHeap[i]=MOVE;
  }
  j=i;
  for (; i < j + 8 * playerNum; i++) {
    cardHeap[i]=SKILLS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=PAPER;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=SCISSORS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=STONE;
  }
  return cardHeap;
}
Program: 72270
Project: 72270
Buggy source:
private void featureChoose(int sid,String msg,Player playerMain){
  int decision=playerMain.stratDecision;
  if (decision == GambleChecker.MOVE)   playerMain.moveDirection=GodHelper.getDecisionFeature(msg).moveDirection();
 else   if (decision == GambleChecker.FIRE)   playerMain.fireTarget=GodHelper.getDecisionFeature(msg).fireTarget();
synchronized (this) {
    feat_choice_count+=1;
    if (feat_choice_count < playerNum) {
      while (feat_choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void featureChoose(int sid,String msg,Player playerMain){
  int decision=playerMain.stratDecision;
  if (decision == GambleChecker.MOVE)   playerMain.moveDirection=GodHelper.getDecisionFeature(msg).moveDirection();
 else   if (decision == GambleChecker.FIRE)   playerMain.fireTarget=GodHelper.getDecisionFeature(msg).fireTarget();
}
Program: 72272
Project: 72272
Buggy source:
public String request(int sid,String msg){
  int playerIndex=0;
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].SID == sid) {
      playerIndex=i;
      break;
    }
  }
  String result="String_Node_Str";
switch (gameState) {
case INIT:
    if (playerState[playerIndex] == 0) {
      result=GodHelper.toInit(allUserInfo,"String_Node_Str",heroList);
      playerState[playerIndex]+=1;
    }
 else     if (playerState[playerIndex] == 1) {
      heroChoose(sid,msg);
      gameState=GameState.MAPINIT;
      playerState[playerIndex]=0;
      result=GodHelper.toChooseHero("String_Node_Str",heroChoices,teamResult);
    }
  break;
case MAPINIT:
break;
case MAINGAME:
switch (phaseState) {
case PREPARE:
if (playerState[playerIndex] == 0) {
  gc.cardDistribute(cardHeap,allPlayers[playerIndex],4);
  playerHandCard=new int[allPlayers[playerIndex].handCardsNum];
  result=GodHelper.toCardDistribute("String_Node_Str",playerHandCard);
  playerState[playerIndex]+=1;
}
 else if (playerState[playerIndex] == 1) {
  allPlayers[playerIndex].gamble=GodHelper.getChooseDecision(msg).decision();
  allPlayers[playerIndex].gambleNum=GodHelper.getChooseDecision(msg).cardNum();
  result=GodHelper.toChooseDecision("String_Node_Str");
  playerState[playerIndex]+=1;
}
 else if (playerState[playerIndex] == 2) {
  phaseState=PhaseState.GAMBLE;
}
break;
case GAMBLE:
break;
case ACTION:
break;
}
break;
}
if (result.equals("String_Node_Str")) {
System.out.printf("String_Node_Str",sid,msg,gameState.toString());
}
return result;
}

Fixed version (ground truth):
public String request(int sid,String msg){
  int playerIndex=0;
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].SID == sid) {
      playerIndex=i;
      break;
    }
  }
  String result="String_Node_Str";
switch (gameState) {
case INIT:
    if (playerState[playerIndex] == 0) {
      result=GodHelper.toInit(allUserInfo,"String_Node_Str",heroList);
      playerState[playerIndex]+=1;
    }
 else     if (playerState[playerIndex] == 1) {
      heroChoose(sid,msg);
      gameState=GameState.MAPINIT;
      playerState[playerIndex]=0;
      result=GodHelper.toChooseHero("String_Node_Str",heroChoices,teamResult);
    }
  break;
case MAPINIT:
break;
case MAINGAME:
switch (phaseState) {
case PREPARE:
if (playerState[playerIndex] == 0) {
  gc.cardDistribute(cardHeap,allPlayers[playerIndex],4);
  playerHandCard=new int[allPlayers[playerIndex].handCardsNum];
  result=GodHelper.toCardDistribute("String_Node_Str",playerHandCard);
  playerState[playerIndex]+=1;
}
 else if (playerState[playerIndex] == 1) {
  allPlayers[playerIndex].gamble=GodHelper.getChooseDecision(msg).decision();
  allPlayers[playerIndex].gambleNum=GodHelper.getChooseDecision(msg).cardNum();
  result=GodHelper.toChooseDecision("String_Node_Str");
  playerState[playerIndex]+=1;
}
 else if (playerState[playerIndex] == 2) {
  featureChoose(sid,msg);
  phaseState=PhaseState.GAMBLE;
  playerState[playerIndex]=0;
}
break;
case GAMBLE:
break;
case ACTION:
break;
}
break;
}
if (result.equals("String_Node_Str")) {
System.out.printf("String_Node_Str",sid,msg,gameState.toString());
}
return result;
}
Program: 72273
Project: 72273
Buggy source:
private void featureChoose(){
synchronized (this) {
    feat_choice_count+=1;
    if (feat_choice_count < playerNum) {
      while (feat_choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void featureChoose(int sid,String msg){
synchronized (this) {
    feat_choice_count+=1;
    if (feat_choice_count < playerNum) {
      while (feat_choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      this.notifyAll();
    }
  }
}
Program: 72274
Project: 72274
Buggy source:
void cardDistribute(int[] cardHeap,Player playerMain,int cardNum){
  int distributedCardNum=0;
  for (int i=0; i < cardHeap.length; i++) {
    if (cardHeap[i] != NOTHING) {
      cardToPlayer(cardHeap[i],playerMain);
      cardHeap[i]=NOTHING;
      distributedCardNum++;
    }
    if (distributedCardNum == cardNum) {
      cardSort(playerMain.handCards);
      break;
    }
  }
}

Fixed version (ground truth):
static void cardDistribute(int[] cardHeap,Player playerMain,int cardNum){
  int distributedCardNum=0;
  for (int i=0; i < cardHeap.length; i++) {
    if (cardHeap[i] != NOTHING) {
      cardToPlayer(cardHeap[i],playerMain);
      cardHeap[i]=NOTHING;
      distributedCardNum++;
    }
    if (distributedCardNum == cardNum) {
      cardSort(playerMain.handCards);
      break;
    }
  }
}
Program: 72275
Project: 72275
Buggy source:
void cardToPlayer(int card,Player playerMain){
  for (int i=0; i < playerMain.handCards.length; i++) {
    if (playerMain.handCards[i] == NOTHING) {
      playerMain.handCards[i]=card;
      playerMain.handCardsNum++;
      break;
    }
  }
}

Fixed version (ground truth):
static void cardToPlayer(int card,Player playerMain){
  for (int i=0; i < playerMain.handCards.length; i++) {
    if (playerMain.handCards[i] == NOTHING) {
      playerMain.handCards[i]=card;
      playerMain.handCardsNum++;
      break;
    }
  }
}
Program: 72276
Project: 72276
Buggy source:
void cardToHeap(int[] cardHeap,int card){
  int i=(int)(Math.random() * cardHeap.length);
  while (cardHeap[i] != NOTHING)   i=(i + 1) % cardHeap.length;
  cardHeap[i]=card;
}

Fixed version (ground truth):
static void cardToHeap(int[] cardHeap,int card){
  int i=(int)(Math.random() * cardHeap.length);
  while (cardHeap[i] != NOTHING)   i=(i + 1) % cardHeap.length;
  cardHeap[i]=card;
}
Program: 72277
Project: 72277
Buggy source:
int[] cardHeapStir(int[] cardHeap){
  for (int i=0; i < cardHeap.length; i++) {
    int tmp=(int)(Math.random() * cardHeap.length);
    int tmpCard=cardHeap[i];
    cardHeap[i]=cardHeap[tmp];
    cardHeap[tmp]=tmpCard;
  }
  return cardHeap;
}

Fixed version (ground truth):
static int[] cardHeapStir(int[] cardHeap){
  for (int i=0; i < cardHeap.length; i++) {
    int tmp=(int)(Math.random() * cardHeap.length);
    int tmpCard=cardHeap[i];
    cardHeap[i]=cardHeap[tmp];
    cardHeap[tmp]=tmpCard;
  }
  return cardHeap;
}
Program: 72278
Project: 72278
Buggy source:
int[] cardHeapInit(int[] cardHeap,int playerNum){
  int i, j;
  cardHeap=new int[40 * playerNum];
  for (i=0; i < 8 * playerNum; i++) {
    cardHeap[i]=FIRE;
  }
  j=i;
  for (; i < j + 12 * playerNum; i++) {
    cardHeap[i]=MOVE;
  }
  j=i;
  for (; i < j + 8 * playerNum; i++) {
    cardHeap[i]=SKILLS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=PAPER;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=SCISSORS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=STONE;
  }
  return cardHeap;
}

Fixed version (ground truth):
static int[] cardHeapInit(int[] cardHeap,int playerNum){
  int i, j;
  cardHeap=new int[40 * playerNum];
  for (i=0; i < 8 * playerNum; i++) {
    cardHeap[i]=FIRE;
  }
  j=i;
  for (; i < j + 12 * playerNum; i++) {
    cardHeap[i]=MOVE;
  }
  j=i;
  for (; i < j + 8 * playerNum; i++) {
    cardHeap[i]=SKILLS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=PAPER;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=SCISSORS;
  }
  j=i;
  for (; i < j + 4 * playerNum; i++) {
    cardHeap[i]=STONE;
  }
  return cardHeap;
}
Program: 72279
Project: 72279
Buggy source:
void cardDesert(Player playerMain,int[] cardHeap){
  if (playerMain.handCardsNum > playerMain.healthPoint) {
    playerMain.cardsDesertNum=playerMain.handCardsNum - playerMain.healthPoint;
    for (int i=0; i < playerMain.cardsDesertNum; i++) {
      if (playerMain.cardsDesertList[i] != -1) {
        cardToHeap(cardHeap,playerMain.handCards[playerMain.cardsDesertList[i]]);
        playerMain.handCards[playerMain.cardsDesertList[i]]=NOTHING;
        playerMain.handCardsNum--;
      }
    }
    cardSort(playerMain.handCards);
  }
}

Fixed version (ground truth):
static void cardDesert(Player playerMain,int[] cardHeap){
  if (playerMain.handCardsNum > playerMain.healthPoint) {
    playerMain.cardsDesertNum=playerMain.handCardsNum - playerMain.healthPoint;
    for (int i=0; i < playerMain.cardsDesertNum; i++) {
      if (playerMain.cardsDesertList[i] != -1) {
        cardToHeap(cardHeap,playerMain.handCards[playerMain.cardsDesertList[i]]);
        playerMain.handCards[playerMain.cardsDesertList[i]]=NOTHING;
        playerMain.handCardsNum--;
      }
    }
    cardSort(playerMain.handCards);
  }
}
Program: 72280
Project: 72280
Buggy source:
void cardSort(int[] cardHeap){
  for (int i=0; i < cardHeap.length; i++) {
    for (int j=i; j < cardHeap.length; j++) {
      if (cardHeap[i] < cardHeap[j]) {
        int tmp=cardHeap[i];
        cardHeap[i]=cardHeap[j];
        cardHeap[j]=tmp;
      }
    }
  }
}

Fixed version (ground truth):
static void cardSort(int[] cardHeap){
  for (int i=0; i < cardHeap.length; i++) {
    for (int j=i; j < cardHeap.length; j++) {
      if (cardHeap[i] < cardHeap[j]) {
        int tmp=cardHeap[i];
        cardHeap[i]=cardHeap[j];
        cardHeap[j]=tmp;
      }
    }
  }
}
Program: 72281
Project: 72281
Buggy source:
private void heroChoose(int sid,String msg){
  int playerIndex;
  String heroChoice;
  MsgChooseHero choose=GodHelper.getChooseHero(msg);
synchronized (this) {
    choice_count+=1;
    for (playerIndex=0; playerIndex < playerNum; playerIndex++) {
      if (allPlayers[playerIndex].SID == sid) {
        allPlayers[playerIndex].chara=choose.hero();
        heroChoices[playerIndex]=choose.hero();
      }
    }
    if (choice_count < playerNum) {
      while (choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      teamDivide();
      gc.cardHeapInit(cardHeap,playerNum);
      gc.cardHeapStir(cardHeap);
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void heroChoose(int sid,String msg){
  int playerIndex;
  String heroChoice;
  MsgChooseHero choose=GodHelper.getChooseHero(msg);
synchronized (this) {
    choice_count+=1;
    for (playerIndex=0; playerIndex < playerNum; playerIndex++) {
      if (allPlayers[playerIndex].SID == sid) {
        allPlayers[playerIndex].chara=choose.hero();
        heroChoices[playerIndex]=choose.hero();
      }
    }
    if (choice_count < playerNum) {
      while (choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      teamDivide();
      GambleChecker.cardHeapInit(cardHeap,playerNum);
      GambleChecker.cardHeapStir(cardHeap);
      this.notifyAll();
    }
  }
}
Program: 72283
Project: 72283
Buggy source:
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].handCards=new int[40 * playerNum];
    allPlayers[i].cardsDesertNum=0;
    allPlayers[i].cardsDesertList=new int[40 * playerNum];
    playerState[i]=0;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}

Fixed version (ground truth):
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  playerState=new int[playerNum];
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  cardHeap=new int[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allPlayers[i].handCardsNum=0;
    allPlayers[i].handCards=new int[40 * playerNum];
    allPlayers[i].cardsDesertNum=0;
    allPlayers[i].cardsDesertList=new int[40 * playerNum];
    playerState[i]=0;
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}
Program: 72284
Project: 72284
Buggy source:
public void initialPlayer(int[] playerSID){
  int playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    allUserInfo[i]=new UserInfo(i,allPlayers[i].nickName);
  }
}

Fixed version (ground truth):
public void initialPlayer(int[] playerSID){
  playerNum=playerSID.length;
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  heroChoices=new String[playerNum];
  teamResult=new int[playerNum];
  allPlayers=new Player[playerNum];
  allUserInfo=new UserInfo[playerNum];
  for (int i=0; i < playerNum; i++) {
    allPlayers[i]=new Player();
    allPlayers[i].SID=playerSID[i];
    Option<UserModel.User> user=UserController.getProfile(playerSID[i]);
    if (user.isEmpty())     allPlayers[i].user_info=GodHelper.ghostUser();
 else     allPlayers[i].user_info=user.get();
    allUserInfo[i]=new UserInfo(i,allPlayers[i].user_info.nickname());
  }
}
Program: 72285
Project: 72285
Buggy source:
private void teamDivide(Player[] allPlayer){
  int zombie=(int)(Math.random() * allPlayer.length);
  allPlayer[zombie].team=Player.ZOMBIE;
  teamResult[zombie]=Player.ZOMBIE;
  for (int i=0; i < allPlayer.length; i++) {
    if (i != zombie) {
      allPlayer[i].team=Player.HUMAN;
      teamResult[i]=Player.HUMAN;
    }
  }
  ;
}

Fixed version (ground truth):
private void teamDivide(Player[] allPlayer){
  int zombie=(int)(Math.random() * allPlayer.length);
  allPlayer[zombie].team=Player.ZOMBIE;
  teamResult[zombie]=Player.ZOMBIE;
  for (int i=0; i < allPlayer.length; i++) {
    if (i != zombie) {
      allPlayer[i].team=Player.HUMAN;
      teamResult[i]=Player.HUMAN;
    }
  }
}
Program: 72286
Project: 72286
Buggy source:
private void heroChoose(int sid,String msg){
  int playerIndex;
  String heroChoice;
  MsgChooseHero choose=GodHelper.getChooseHero(msg);
synchronized (this) {
    choice_count+=1;
    for (playerIndex=0; playerIndex < playerNum; playerIndex++) {
      if (allPlayers[playerIndex].SID == sid) {
        allPlayers[playerIndex].chara=choose.hero();
        heroChoices[playerIndex]=choose.hero();
      }
    }
    if (choice_count < playerNum) {
      while (choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      this.notifyAll();
    }
  }
}

Fixed version (ground truth):
private void heroChoose(int sid,String msg){
  int playerIndex;
  String heroChoice;
  MsgChooseHero choose=GodHelper.getChooseHero(msg);
synchronized (this) {
    choice_count+=1;
    for (playerIndex=0; playerIndex < playerNum; playerIndex++) {
      if (allPlayers[playerIndex].SID == sid) {
        allPlayers[playerIndex].chara=choose.hero();
        heroChoices[playerIndex]=choose.hero();
      }
    }
    if (choice_count < playerNum) {
      while (choice_count < playerNum) {
        try {
          this.wait();
        }
 catch (        Exception ex) {
          ex.printStackTrace();
        }
      }
    }
 else {
      teamDivide();
      this.notifyAll();
    }
  }
}
Program: 72287
Project: 72287
Buggy source:
public String request(int sid,String msg){
}

Fixed version (ground truth):
public String request(int sid,String msg){
  int playerIndex=0;
  for (int i=0; i < playerNum; i++) {
    if (allPlayers[i].SID == sid) {
      playerIndex=i;
      break;
    }
  }
  String result="String_Node_Str";
switch (gameState) {
case INIT:
    if (playerState[playerIndex] == 0) {
      result=GodHelper.toInit(allUserInfo,"String_Node_Str",heroList);
      playerState[playerIndex]=1;
    }
 else     if (playerState[playerIndex] == 1) {
      heroChoose(sid,msg);
      gameState=GameState.MAPINIT;
      playerState[playerIndex]=0;
      result=GodHelper.toChooseHero("String_Node_Str",heroChoices,teamResult);
    }
  break;
case MAPINIT:
break;
}
if (result.equals("String_Node_Str")) {
System.out.printf("String_Node_Str",sid,msg,gameState.toString());
}
return result;
}
Program: 72288
Project: 72288
Buggy source:
private void teamDivide(Player[] allPlayer){
  int zombie=(int)(Math.random() * allPlayer.length);
  allPlayer[zombie].team=Player.ZOMBIE;
  teamResult[zombie]=Player.ZOMBIE;
  for (int i=0; i < allPlayer.length; i++) {
    if (i != zombie) {
      allPlayer[i].team=Player.HUMAN;
      teamResult[i]=Player.HUMAN;
    }
  }
}

Fixed version (ground truth):
private void teamDivide(){
  int zombie=(int)(Math.random() * playerNum);
  allPlayers[zombie].team=Player.ZOMBIE;
  teamResult[zombie]=Player.ZOMBIE;
  for (int i=0; i < allPlayers.length; i++) {
    if (i != zombie) {
      allPlayers[i].team=Player.HUMAN;
      teamResult[i]=Player.HUMAN;
    }
  }
}
Program: 72289
Project: 72289
Buggy source:
@Then("String_Node_Str") public void there_should_be_result_for(int count,String searchTerm,String sadf){
  int actual=searchResultsPage.resultsLink(searchTerm).size();
  assertEquals(count,actual,"String_Node_Str");
}

Fixed version (ground truth):
@Then("String_Node_Str") public void there_should_be_result_for(int count,String searchTerm){
  int actual=searchResultsPage.resultsLink(searchTerm).size();
  assertEquals(actual,count,"String_Node_Str");
}
Program: 72291
Project: 72291
Buggy source:
protected void initPreview(SashForm sashForm){
  temporaryInternalPreviewFile=asciidoctorWrapper.getTempFileFor(getEditorFile(),TemporaryFileType.INTERNAL_PREVIEW);
  temporaryExternalPreviewFile=asciidoctorWrapper.getTempFileFor(getEditorFile(),TemporaryFileType.EXTERNAL_PREVIEW);
  browserAccess.ensureBrowser(new BrowserContentInitializer(){
    @Override public void initialize(    Browser browser){
    }
  }
);
  showRebuildingInPreviewAndTriggerFullHTMLRebuildAsJob();
  PreviewLayout layout=getLayoutMode();
  if (layout.isExternal()) {
    setPreviewVisible(false);
  }
 else {
    setPreviewVisible(true);
    setVerticalSplit(layout.isVertical());
  }
}

Fixed version (ground truth):
protected void initPreview(SashForm sashForm){
  File editorFileOrNull=getEditorFileOrNull();
  if (editorFileOrNull == null) {
    setErrorMessage("String_Node_Str");
    return;
  }
  temporaryInternalPreviewFile=asciidoctorWrapper.getTempFileFor(editorFileOrNull,TemporaryFileType.INTERNAL_PREVIEW);
  temporaryExternalPreviewFile=asciidoctorWrapper.getTempFileFor(editorFileOrNull,TemporaryFileType.EXTERNAL_PREVIEW);
  browserAccess.ensureBrowser(new BrowserContentInitializer(){
    @Override public void initialize(    Browser browser){
    }
  }
);
  showRebuildingInPreviewAndTriggerFullHTMLRebuildAsJob();
  PreviewLayout layout=getLayoutMode();
  if (layout.isExternal()) {
    setPreviewVisible(false);
  }
 else {
    setPreviewVisible(true);
    setVerticalSplit(layout.isVertical());
  }
}
Program: 72292
Project: 72292
Buggy source:
public void openInclude(String fileName){
  IWorkbenchPage activePage=getActivePage();
  File file=new File(getEditorFile().getParentFile(),fileName);
  if (!file.exists()) {
    MessageDialog.openWarning(getActiveWorkbenchShell(),"String_Node_Str","String_Node_Str" + fileName);
    return;
  }
  try {
    IDE.openEditor(activePage,file.toURI(),AsciiDoctorEditor.EDITOR_ID,true);
    return;
  }
 catch (  PartInitException e) {
    AsciiDoctorEditorUtil.logError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void openInclude(String fileName){
  IWorkbenchPage activePage=getActivePage();
  File editorFileOrNull=getEditorFileOrNull();
  if (editorFileOrNull == null) {
    MessageDialog.openWarning(getActiveWorkbenchShell(),"String_Node_Str","String_Node_Str" + fileName);
    return;
  }
  File file=new File(editorFileOrNull.getParentFile(),fileName);
  if (!file.exists()) {
    MessageDialog.openWarning(getActiveWorkbenchShell(),"String_Node_Str","String_Node_Str" + fileName);
    return;
  }
  try {
    IDE.openEditor(activePage,file.toURI(),AsciiDoctorEditor.EDITOR_ID,true);
    return;
  }
 catch (  PartInitException e) {
    AsciiDoctorEditorUtil.logError("String_Node_Str",e);
  }
}
Program: 72294
Project: 72294
Buggy source:
/** 
 * This method should normally only be used when we have no file access - e.g. in compare modes etc.
 * @param asciiDoc
 * @return html string
 * @throws Exception 
 */
public String convertToHTML(String asciiDoc) throws Exception {
  File baseFile=new File("String_Node_Str");
  String imagesPath=asciiDoc.indexOf("String_Node_Str") == -1 ? baseFile.getAbsolutePath() : null;
  try {
    return getAsciiDoctor().convert(asciiDoc,getDefaultOptions(baseFile,imagesPath));
  }
 catch (  Exception e) {
    logAdapter.logError("String_Node_Str",e);
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * This method should normally only be used when we have no file access - e.g. in compare modes etc.
 * @param asciiDoc
 * @return html string
 * @throws Exception 
 */
public String convertToHTML(String asciiDoc) throws Exception {
  File baseFile=new File("String_Node_Str");
  String imagesPath=asciiDoc.indexOf("String_Node_Str") == -1 ? baseFile.getAbsolutePath() : null;
  try {
    return getAsciiDoctor().convert(asciiDoc,getDefaultOptions(null,baseFile,imagesPath));
  }
 catch (  Exception e) {
    logAdapter.logError("String_Node_Str",e);
    throw e;
  }
}
Program: 72295
Project: 72295
Buggy source:
@Override public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer){
  if (sourceViewer == null)   return null;
  return new IHyperlinkDetector[]{new URLHyperlinkDetector(),new AsciiDoctorEditorHyperlinkDetector(adaptable)};
}

Fixed version (ground truth):
@Override public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer){
  if (sourceViewer == null) {
    return null;
  }
  return new IHyperlinkDetector[]{new AsciiDoctorURLHyperlinkDetector(),new AsciiDoctorEditorLinkTextHyperlinkDetector(adaptable)};
}