nus-yam/ex-repair huggingface dataset:
Program: 40522
Project: 40522
Buggy source:
/** 
 * Number of tiles to get to opponent using only horizontal and vertical movement
 * @param playerId
 * @param opponentId
 * @return
 */
public int pathDistanceToPlayer(int playerId,int opponentId){
  Point distances=getDeltaDistances(playerId,opponentId);
  return (Math.abs(distances.x) + Math.abs(distances.y)) - 1;
}

Fixed version (ground truth):
/** 
 * Number of tiles to get to opponent using only horizontal and vertical movement
 * @param playerId
 * @param opponentId
 * @return
 */
public int pathDistanceToPlayer(int playerId,int opponentId){
  Point distances=getDeltaDistances(playerId,opponentId);
  return Math.abs(distances.x) + Math.abs(distances.y);
}
Program: 40523
Project: 40523
Buggy source:
/** 
 * Attacks location x and y away from players current location
 * @param playerId Player
 * @param x        Units away from players current location
 * @param y        Units away from players current location
 * @return If player was able to attack
 */
private boolean attackLocation(int playerId,int x,int y){
  EntityTile playerTile=this._entityMap.getPlayers().get(playerId);
  Point location=playerTile.getLocation();
  if (!_entityMap.isInsideMap(new Point(location.x + x,location.y + y))) {
    return false;
  }
  Entity entity=getEntityAtLocation(new Point(location.x + x,location.y + y));
  Player player=(Player)playerTile.getEntity();
  player.setShielding(false);
  if (entity.getEntityType() == Entity.EntityType.EMPTY) {
    return false;
  }
 else {
    Player playerToAttack=(Player)entity;
    int damageToBeDone=player.getDamage();
    if (playerToAttack.isShielding()) {
      damageToBeDone=player.getDamage() - playerToAttack.getShieldStrength();
    }
    playerToAttack.setHealth(playerToAttack.getHealth() - damageToBeDone);
    if (playerToAttack.getHealth() <= HEALTH_DEAD) {
      playerToAttack.setHealth(0);
      this._isGameOver=true;
    }
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Attacks location x and y away from players current location
 * @param playerId Player
 * @param x        Units away from players current location
 * @param y        Units away from players current location
 * @return If player was able to attack
 */
private boolean attackLocation(int playerId,int x,int y){
  EntityTile playerTile=this._entityMap.getPlayers().get(playerId);
  Point location=playerTile.getLocation();
  stopDefending(playerId);
  if (!_entityMap.isInsideMap(new Point(location.x + x,location.y + y))) {
    return false;
  }
  Entity entity=getEntityAtLocation(new Point(location.x + x,location.y + y));
  Player player=(Player)playerTile.getEntity();
  if (entity.getEntityType() == Entity.EntityType.EMPTY) {
    return false;
  }
 else {
    Player playerToAttack=(Player)entity;
    int damageToBeDone=player.getDamage();
    if (playerToAttack.isShielding()) {
      damageToBeDone=player.getDamage() - playerToAttack.getShieldStrength();
    }
    playerToAttack.setHealth(playerToAttack.getHealth() - damageToBeDone);
    if (playerToAttack.getHealth() <= HEALTH_DEAD) {
      playerToAttack.setHealth(0);
      this._isGameOver=true;
    }
    return true;
  }
}
Program: 40524
Project: 40524
Buggy source:
/** 
 * Checks to see whether or not the current player has been in their location for NUMBER_OF_TURNS_TO_STALEMATE
 * @param playerId
 * @return If the users has not moved in NUMBER_OF_TURNS_TO_STALEMATE
 */
private boolean isStalemateTurnForPlayer(int playerId){
  if (_previousLocations.get(playerId).x == getPlayer(playerId).getLocation().x && _previousLocations.get(playerId).y == getPlayer(playerId).getLocation().y) {
    _numberOfTimesAtCurrentLocation.set(playerId,_numberOfTimesAtCurrentLocation.get(playerId) + 1);
    if (_numberOfTimesAtCurrentLocation.get(playerId) > NUMBER_OF_TURNS_TO_STALEMATE) {
      return true;
    }
 else {
      _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    }
  }
 else {
    _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    _numberOfTimesAtCurrentLocation.set(playerId,1);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks to see whether or not the current player has been in their location and not taken damage for NUMBER_OF_TURNS_TO_STALEMATE
 * @param playerId
 * @return If the users has not moved in NUMBER_OF_TURNS_TO_STALEMATE
 */
private boolean isStalemateTurnForPlayer(int playerId){
  if (_previousLocations.get(playerId).x == getPlayer(playerId).getLocation().x && _previousLocations.get(playerId).y == getPlayer(playerId).getLocation().y && _previousHealth.get(playerId) == getPlayer(playerId).getHealth()) {
    _numberOfStalemateTurns.set(playerId,_numberOfStalemateTurns.get(playerId) + 1);
    if (_numberOfStalemateTurns.get(playerId) > NUMBER_OF_TURNS_TO_STALEMATE) {
      return true;
    }
 else {
      _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
      _previousHealth.set(playerId,getPlayer(playerId).getHealth());
    }
  }
 else {
    _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    _previousHealth.set(playerId,getPlayer(playerId).getHealth());
    _numberOfStalemateTurns.set(playerId,1);
  }
  return false;
}
Program: 40525
Project: 40525
Buggy source:
/** 
 * @param entityMap
 */
public Game(EntityMap entityMap){
  this._entityMap=entityMap;
  _previousLocations.add(getPlayer(PLAYER_ID).getLocation());
  _previousLocations.add(getPlayer(OPPONENT_ID).getLocation());
  _numberOfTimesAtCurrentLocation.add(1);
  _numberOfTimesAtCurrentLocation.add(1);
}

Fixed version (ground truth):
/** 
 * @param entityMap
 */
public Game(EntityMap entityMap){
  this._entityMap=entityMap;
  _previousLocations.add(getPlayer(PLAYER_ID).getLocation());
  _previousLocations.add(getPlayer(OPPONENT_ID).getLocation());
  _numberOfStalemateTurns.add(1);
  _numberOfStalemateTurns.add(1);
  _previousHealth.add(getPlayer(PLAYER_ID).getHealth());
  _previousHealth.add(getPlayer(OPPONENT_ID).getHealth());
}
Program: 40526
Project: 40526
Buggy source:
/** 
 * Returns updated entityMap.
 * @return Updated EntityMap
 */
public Map nextTurn(){
  if (!isGameOver()) {
    boolean isStalemateForPlayer=isStalemateTurnForPlayer(PLAYER_ID);
    boolean isStalemateForOpponent=isStalemateTurnForPlayer(OPPONENT_ID);
    if (isStalemateForPlayer && isStalemateForOpponent) {
      _isStalemate=true;
      this._isGameOver=true;
    }
 else     if (this._numberOfTurnsCompleted > MAX_TURN_LIMIT) {
      _isStalemate=true;
      this._isGameOver=true;
    }
    this._numberOfTurnsCompleted++;
  }
  return this._entityMap.getMap();
}

Fixed version (ground truth):
/** 
 * Returns updated entityMap.
 * @return Updated EntityMap
 */
public Map nextTurn(){
  if (!isGameOver()) {
    boolean isStalemateForPlayer=isStalemateTurnForPlayer(PLAYER_ID);
    boolean isStalemateForOpponent=isStalemateTurnForPlayer(OPPONENT_ID);
    if (isStalemateForPlayer || isStalemateForOpponent) {
      _isStalemate=true;
      this._isGameOver=true;
    }
 else     if (this._numberOfTurnsCompleted > MAX_TURN_LIMIT) {
      _isStalemate=true;
      this._isGameOver=true;
    }
    this._numberOfTurnsCompleted++;
  }
  return this._entityMap.getMap();
}
Program: 40527
Project: 40527
Buggy source:
/** 
 * Performs all of the necessary game logic for one tick, or turn, if currently in-game.
 */
public Map tick(){
  if (game == null) {
    ENGINE_LOGGER.critical("String_Node_Str");
    return null;
  }
  if (_isPlayerTurn) {
    List<ScriptCommand> playerCommands=this.gameGUI.getCommandObjects();
    boolean playerCommandExecuted=false;
    for (    ScriptCommand pc : playerCommands) {
      boolean executed=pc.doCommand(this.game,0);
      if (executed) {
        playerCommandExecuted=true;
        break;
      }
    }
    if (!playerCommandExecuted)     this.game.doNothing(0);
  }
 else {
    boolean computerCommandExecuted=false;
    for (    ScriptCommand cc : this.cpuCommands) {
      boolean executed=cc.doCommand(this.game,1);
      if (executed) {
        computerCommandExecuted=true;
        break;
      }
    }
    if (!computerCommandExecuted)     this.game.doNothing(1);
  }
  this._isPlayerTurn=!_isPlayerTurn;
  return game.nextTurn();
}

Fixed version (ground truth):
/** 
 * Performs all of the necessary game logic for one tick, or turn, if currently in-game.
 */
public Map tick(){
  if (game == null) {
    ENGINE_LOGGER.critical("String_Node_Str");
    return null;
  }
  if (!game.isGameOver()) {
    if (_isPlayerTurn) {
      List<ScriptCommand> playerCommands=this.gameGUI.getCommandObjects();
      boolean playerCommandExecuted=false;
      for (      ScriptCommand pc : playerCommands) {
        boolean executed=pc.doCommand(this.game,0);
        if (executed) {
          playerCommandExecuted=true;
          break;
        }
      }
      if (!playerCommandExecuted)       this.game.doNothing(0);
    }
 else {
      boolean computerCommandExecuted=false;
      for (      ScriptCommand cc : this.cpuCommands) {
        boolean executed=cc.doCommand(this.game,1);
        if (executed) {
          computerCommandExecuted=true;
          break;
        }
      }
      if (!computerCommandExecuted)       this.game.doNothing(1);
    }
    this._isPlayerTurn=!_isPlayerTurn;
  }
  return game.nextTurn();
}
Program: 40528
Project: 40528
Buggy source:
public void generateCPUScript(){
  this.cpuCommands=new ArrayList<>();
  ArrayList<Check> checks=new ArrayList<>();
}

Fixed version (ground truth):
public void generateCPUScript(){
  this.cpuCommands=new ArrayList<>();
  ArrayList<Check> checks=new ArrayList<>();
  ArrayList<Check> checksForAttack=new ArrayList<>();
  checks.add(new Check(Data.DISTANCE_FROM_OPPONENT.text(),"String_Node_Str",Operator.GREATER_THAN));
  ScriptCommand approach=new ScriptCommand(checks,Command.APPROACH);
  this.cpuCommands.add(approach);
  checksForAttack.add(new Check(Data.DISTANCE_FROM_OPPONENT.text(),Data.DISTANCE_FROM_OPPONENT.text(),Operator.EQUALS));
  ScriptCommand attack=new ScriptCommand(checksForAttack,Command.ATTACK);
  this.cpuCommands.add(attack);
}
Program: 40530
Project: 40530
Buggy source:
/** 
 * Called by doCommand to actually modify the game data with built-in functions
 * @param game the instance of the game class passed in
 * @param id the id of the player excecuting this script
 */
private void executeFunction(Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
switch (this.command) {
case APPROACH:
    game.approach(id,otherId);
  break;
case ATTACK:
game.attack(id);
case HEAL:
game.heal(id,20);
break;
case EVADE:
game.evade(id,otherId);
case DO_NOTHING:
game.doNothing(id);
break;
case DEFEND:
game.defend(id);
break;
default :
game.doNothing(id);
break;
}
}

Fixed version (ground truth):
/** 
 * Called by doCommand to actually modify the game data with built-in functions
 * @param game the instance of the game class passed in
 * @param id the id of the player executing this script
 */
private void executeFunction(Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
  if (id == 1) {
    System.out.println("String_Node_Str" + id + "String_Node_Str"+ this.command);
  }
switch (this.command) {
case APPROACH:
    game.approach(id,otherId);
  break;
case ATTACK:
game.attack(id);
break;
case HEAL:
game.heal(id,20);
break;
case EVADE:
game.evade(id,otherId);
case DO_NOTHING:
game.doNothing(id);
break;
case DEFEND:
game.defend(id);
break;
default :
game.doNothing(id);
break;
}
}
Program: 40531
Project: 40531
Buggy source:
/** 
 * If opponent is within one tile horizontally or vertically, player will attack that tile.  If not, returns false
 * @param playerId Player
 * @return If player was able to attack
 */
public boolean attack(int playerId){
  stopDefending(playerId);
  if (attackLocation(0,0,1)) {
    return true;
  }
 else   if (attackLocation(0,0,-1)) {
    return true;
  }
 else   if (attackLocation(0,1,0)) {
    return true;
  }
 else   if (attackLocation(0,-1,0)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * If opponent is within one tile horizontally or vertically, player will attack that tile.  If not, returns false
 * @param playerId Player
 * @return If player was able to attack
 */
public boolean attack(int playerId){
  stopDefending(playerId);
  System.out.println("String_Node_Str" + playerId);
  if (attackLocation(playerId,0,1)) {
    return true;
  }
 else   if (attackLocation(playerId,0,-1)) {
    return true;
  }
 else   if (attackLocation(playerId,1,0)) {
    return true;
  }
 else   if (attackLocation(playerId,-1,0)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 40532
Project: 40532
Buggy source:
/** 
 * Checks to see whether or not the current player has been in their location for NUMBER_OF_TURNS_TO_STALEMATE
 * @param playerId
 * @return
 */
private boolean isStalemateTurnForPlayer(int playerId){
  if (playerId == 0) {
    System.out.println(1);
  }
  if (_previousLocations.get(playerId).x == getPlayer(playerId).getLocation().x && _previousLocations.get(playerId).y == getPlayer(playerId).getLocation().y) {
    _numberOfTimesAtCurrentLocation.set(playerId,_numberOfTimesAtCurrentLocation.get(playerId) + 1);
    if (_numberOfTimesAtCurrentLocation.get(playerId) > NUMBER_OF_TURNS_TO_STALEMATE) {
      return true;
    }
 else {
      _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    }
  }
 else {
    _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    _numberOfTimesAtCurrentLocation.set(playerId,1);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks to see whether or not the current player has been in their location for NUMBER_OF_TURNS_TO_STALEMATE
 * @param playerId
 * @return If the users has not moved in NUMBER_OF_TURNS_TO_STALEMATE
 */
private boolean isStalemateTurnForPlayer(int playerId){
  if (_previousLocations.get(playerId).x == getPlayer(playerId).getLocation().x && _previousLocations.get(playerId).y == getPlayer(playerId).getLocation().y) {
    _numberOfTimesAtCurrentLocation.set(playerId,_numberOfTimesAtCurrentLocation.get(playerId) + 1);
    if (_numberOfTimesAtCurrentLocation.get(playerId) > NUMBER_OF_TURNS_TO_STALEMATE) {
      return true;
    }
 else {
      _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    }
  }
 else {
    _previousLocations.set(playerId,new Point(getPlayer(playerId).getLocation()));
    _numberOfTimesAtCurrentLocation.set(playerId,1);
  }
  return false;
}
Program: 40533
Project: 40533
Buggy source:
/** 
 * Used by external classes to acquire game state.
 * @return The GameStatus pertaining to the current state of the game.
 */
public GameStatus getState(){
  if (!isGameOver()) {
    return GameStatus.RUNNING;
  }
  if (isStalemate()) {
    return GameStatus.STALEMATE;
  }
  LOGGER.warning("String_Node_Str");
  if (isDead(0)) {
    return GameStatus.LOST;
  }
 else   if (isDead(1)) {
    System.out.println("String_Node_Str");
    return GameStatus.WON;
  }
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Used by external classes to acquire game state.
 * @return The GameStatus pertaining to the current state of the game.
 */
public GameStatus getState(){
  if (!isGameOver()) {
    return GameStatus.RUNNING;
  }
  if (isStalemate()) {
    return GameStatus.STALEMATE;
  }
  LOGGER.warning("String_Node_Str");
  if (isDead(0)) {
    return GameStatus.LOST;
  }
 else   if (isDead(1)) {
    System.out.println(getPlayer(1).getHealth());
    return GameStatus.WON;
  }
  throw new RuntimeException("String_Node_Str");
}
Program: 40534
Project: 40534
Buggy source:
/** 
 * Returns updated entityMap.
 * @return Updated EntityMap
 */
public Map nextTurn(){
  boolean isStalemateForPlayer=isStalemateTurnForPlayer(PLAYER_ID);
  boolean isStalemateForOpponent=isStalemateTurnForPlayer(OPPONENT_ID);
  if (isStalemateForPlayer && isStalemateForOpponent) {
    _isStalemate=true;
    this._isGameOver=true;
  }
 else   if (this._numberOfTurnsCompleted > MAX_TURN_LIMIT) {
    _isStalemate=true;
    this._isGameOver=true;
  }
  this._numberOfTurnsCompleted++;
  return this._entityMap.getMap();
}

Fixed version (ground truth):
/** 
 * Returns updated entityMap.
 * @return Updated EntityMap
 */
public Map nextTurn(){
  if (!isGameOver()) {
    boolean isStalemateForPlayer=isStalemateTurnForPlayer(PLAYER_ID);
    boolean isStalemateForOpponent=isStalemateTurnForPlayer(OPPONENT_ID);
    if (isStalemateForPlayer && isStalemateForOpponent) {
      _isStalemate=true;
      this._isGameOver=true;
    }
 else     if (this._numberOfTurnsCompleted > MAX_TURN_LIMIT) {
      _isStalemate=true;
      this._isGameOver=true;
    }
    this._numberOfTurnsCompleted++;
  }
  return this._entityMap.getMap();
}
Program: 40535
Project: 40535
Buggy source:
/** 
 * Performs all of the required actions for the UI to tick.
 * @param ts The ticking service to be used for engine tick calls.
 */
private void uiTick(TickingService ts){
  if (!_engine.isRunning()) {
    LOGGER.info("String_Node_Str");
    if (!_engine.cleanup()) {
      LOGGER.critical("String_Node_Str");
      System.exit(1);
    }
    System.exit(0);
  }
  updateGameGUI();
  ts.restart();
}

Fixed version (ground truth):
/** 
 * Performs all of the required actions for the UI to tick.
 * @param ts The ticking service to be used for engine tick calls.
 */
private void uiTick(TickingService ts){
  if (!_engine.isRunning()) {
    LOGGER.info("String_Node_Str");
    if (!_engine.cleanup()) {
      LOGGER.critical("String_Node_Str");
      System.exit(1);
    }
    return;
  }
  updateGameGUI();
  ts.restart();
}
Program: 40536
Project: 40536
Buggy source:
@Override public void start(Stage primaryStage) throws Exception {
  FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
  Parent root=loader.load();
  ObservableMap namespace=loader.getNamespace();
  AnchorPane pane=(AnchorPane)namespace.get("String_Node_Str");
  Group group=new Group();
  _imagePane=new Pane();
  _imagePane.setPrefSize(800,480);
  pane.getChildren().add(group);
  group.getChildren().add(_imagePane);
  primaryStage.setTitle("String_Node_Str");
  primaryStage.setScene(new Scene(root,800,480));
  primaryStage.setResizable(false);
  primaryStage.show();
  startUIUpdateThread();
}

Fixed version (ground truth):
@Override public void start(Stage primaryStage) throws Exception {
  FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
  Parent root=loader.load();
  ObservableMap namespace=loader.getNamespace();
  AnchorPane pane=(AnchorPane)namespace.get("String_Node_Str");
  Group group=new Group();
  _imagePane=new Pane();
  _imagePane.setPrefSize(800,480);
  pane.getChildren().add(group);
  group.getChildren().add(_imagePane);
  this._stage=primaryStage;
  primaryStage.setTitle("String_Node_Str");
  primaryStage.setScene(new Scene(root,800,480));
  primaryStage.setResizable(false);
  primaryStage.show();
  startUIUpdateThread();
}
Program: 40538
Project: 40538
Buggy source:
/** 
 * Performs all of the necessary game logic for one tick, or turn, if currently in-game.
 */
public Map tick(){
  if (game == null) {
    ENGINE_LOGGER.critical("String_Node_Str");
    return null;
  }
  if (game.getNumberOfTurnsCompleted() > 30) {
    this.shutdown();
  }
  List<ScriptCommand> playerCommands=this.gameGUI.getCommandObjects();
  boolean playerCommandExecuted=false;
  for (  ScriptCommand pc : playerCommands) {
    boolean executed=pc.doCommand(this.game,0);
    if (executed) {
      playerCommandExecuted=true;
      break;
    }
  }
  if (!playerCommandExecuted)   this.game.doNothing(0);
  boolean computerCommandExecuted=false;
  for (  ScriptCommand cc : this.cpuCommands) {
    boolean executed=cc.doCommand(this.game,1);
    if (executed) {
      computerCommandExecuted=true;
      break;
    }
  }
  if (!computerCommandExecuted)   this.game.doNothing(1);
  return game.nextTurn();
}

Fixed version (ground truth):
/** 
 * Performs all of the necessary game logic for one tick, or turn, if currently in-game.
 */
public Map tick(){
  if (game == null) {
    ENGINE_LOGGER.critical("String_Node_Str");
    return null;
  }
  List<ScriptCommand> playerCommands=this.gameGUI.getCommandObjects();
  boolean playerCommandExecuted=false;
  for (  ScriptCommand pc : playerCommands) {
    boolean executed=pc.doCommand(this.game,0);
    if (executed) {
      playerCommandExecuted=true;
      break;
    }
  }
  if (!playerCommandExecuted)   this.game.doNothing(0);
  boolean computerCommandExecuted=false;
  for (  ScriptCommand cc : this.cpuCommands) {
    boolean executed=cc.doCommand(this.game,1);
    if (executed) {
      computerCommandExecuted=true;
      break;
    }
  }
  if (!computerCommandExecuted)   this.game.doNothing(1);
  return game.nextTurn();
}
Program: 40539
Project: 40539
Buggy source:
/** 
 * Called by doCommand to actually modify the game data with built-in functions
 * @param game the instance of the game class passed in
 * @param id the id of the player excecuting this script
 */
private void executeFunction(Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
switch (this.command) {
case APPROACH:
    game.approach(id,otherId);
  break;
case ATTACK:
if (!game.approach(id,otherId)) {
  game.attack(id);
}
case HEAL:
game.heal(id,20);
break;
case DO_NOTHING:
game.doNothing(id);
break;
case DEFEND:
game.defend(id);
break;
default :
game.doNothing(id);
break;
}
}

Fixed version (ground truth):
/** 
 * Called by doCommand to actually modify the game data with built-in functions
 * @param game the instance of the game class passed in
 * @param id the id of the player excecuting this script
 */
private void executeFunction(Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
switch (this.command) {
case APPROACH:
    game.approach(id,otherId);
  break;
case ATTACK:
if (!game.approach(id,otherId)) {
  game.attack(id);
}
case HEAL:
game.heal(id,20);
break;
case EVADE:
game.evade(id,otherId);
case DO_NOTHING:
game.doNothing(id);
break;
case DEFEND:
game.defend(id);
break;
default :
game.doNothing(id);
break;
}
}
Program: 40540
Project: 40540
Buggy source:
/** 
 * Used by external classes to acquire game state.
 * @return The GameStatus pertaining to the current state of the game.
 */
public GameStatus getState(){
  if (!isGameOver()) {
    return GameStatus.RUNNING;
  }
  if (isStalemate()) {
    return GameStatus.STALEMATE;
  }
  LOGGER.warning("String_Node_Str");
  if (isDead(0)) {
    System.out.println("String_Node_Str");
    return GameStatus.LOST;
  }
 else   if (isDead(1)) {
    System.out.println("String_Node_Str");
    return GameStatus.WON;
  }
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Used by external classes to acquire game state.
 * @return The GameStatus pertaining to the current state of the game.
 */
public GameStatus getState(){
  if (!isGameOver()) {
    return GameStatus.RUNNING;
  }
  if (isStalemate()) {
    return GameStatus.STALEMATE;
  }
  LOGGER.warning("String_Node_Str");
  if (isDead(0)) {
    return GameStatus.LOST;
  }
 else   if (isDead(1)) {
    System.out.println("String_Node_Str");
    return GameStatus.WON;
  }
  throw new RuntimeException("String_Node_Str");
}
Program: 40541
Project: 40541
Buggy source:
/** 
 * Performs all of the required actions for the UI to tick.
 * @param ts The ticking service to be used for engine tick calls.
 */
private void uiTick(TickingService ts){
  if (!_engine.isRunning()) {
    LOGGER.info("String_Node_Str");
    if (!_engine.cleanup()) {
      LOGGER.critical("String_Node_Str");
      System.exit(1);
    }
    System.exit(0);
  }
  updateGameGUI();
  ts.restart();
}

Fixed version (ground truth):
/** 
 * Performs all of the required actions for the UI to tick.
 * @param ts The ticking service to be used for engine tick calls.
 */
private void uiTick(TickingService ts){
  if (!_engine.isRunning()) {
    LOGGER.info("String_Node_Str");
    if (!_engine.cleanup()) {
      LOGGER.critical("String_Node_Str");
      System.exit(1);
    }
    return;
  }
  updateGameGUI();
  ts.restart();
}
Program: 40542
Project: 40542
Buggy source:
@Override public void start(Stage primaryStage) throws Exception {
  FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
  Parent root=loader.load();
  ObservableMap namespace=loader.getNamespace();
  AnchorPane pane=(AnchorPane)namespace.get("String_Node_Str");
  Group group=new Group();
  _imagePane=new Pane();
  _imagePane.setPrefSize(800,480);
  pane.getChildren().add(group);
  group.getChildren().add(_imagePane);
  primaryStage.setTitle("String_Node_Str");
  primaryStage.setScene(new Scene(root,800,480));
  primaryStage.setResizable(false);
  primaryStage.show();
  startUIUpdateThread();
}

Fixed version (ground truth):
@Override public void start(Stage primaryStage) throws Exception {
  FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
  Parent root=loader.load();
  ObservableMap namespace=loader.getNamespace();
  AnchorPane pane=(AnchorPane)namespace.get("String_Node_Str");
  Group group=new Group();
  _imagePane=new Pane();
  _imagePane.setPrefSize(800,480);
  pane.getChildren().add(group);
  group.getChildren().add(_imagePane);
  this._stage=primaryStage;
  primaryStage.setTitle("String_Node_Str");
  primaryStage.setScene(new Scene(root,800,480));
  primaryStage.setResizable(false);
  primaryStage.show();
  startUIUpdateThread();
}
Program: 40544
Project: 40544
Buggy source:
/** 
 * Based on the current game state data, returns if condition is true.
 * @param game takes in the model
 * @return if defined condition is true
 */
boolean conditionIsTrue(Game game){
  int data1=getData(this.data1,game);
  int data2=getData(this.data2,game);
switch (this.operator) {
case LESS_THAN:
    return data1 < data2;
case GREATER_THAN:
  return data1 > data2;
case LESS_THAN_OR_EQUAL_TO:
return data1 <= data2;
case GREATER_THAN_OR_EQUAL_TO:
return data1 >= data2;
case EQUALS:
return data1 == data2;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * Based on the current game state data, returns if condition is true.
 * @param game takes in the model
 * @return if defined condition is true
 */
boolean conditionIsTrue(Game game,int id){
  int data1=getData(this.data1,game,id);
  int data2=getData(this.data2,game,id);
switch (this.operator) {
case LESS_THAN:
    return data1 < data2;
case GREATER_THAN:
  return data1 > data2;
case LESS_THAN_OR_EQUAL_TO:
return data1 <= data2;
case GREATER_THAN_OR_EQUAL_TO:
return data1 >= data2;
case EQUALS:
return data1 == data2;
default :
return false;
}
}
Program: 40545
Project: 40545
Buggy source:
/** 
 * Based on the current game state data, returns if condition is true.
 * @param data takes in the data to be returned
 * @param game is the pointer to the game model
 * @return the integer value of the game data that has been looked up
 */
private int getData(String data,Game game){
  if (data.equals(Data.USER_HEALTH.text())) {
    return game.getPlayer(Game.PLAYER_ID).getHealth();
  }
 else   if (data.equals(Data.OPPONENT_HEALTH.text())) {
    return game.getPlayer(Game.OPPONENT_ID).getHealth();
  }
 else   if (data.equals(Data.DISTANCE_FROM_OPPONENT.text())) {
    return (int)Math.round(game.distanceToOpponent(Game.PLAYER_ID,Game.OPPONENT_ID));
  }
 else {
    try {
      return Integer.parseInt(data);
    }
 catch (    Exception ex) {
      System.out.println("String_Node_Str" + data + "String_Node_Str");
      return -1;
    }
  }
}

Fixed version (ground truth):
/** 
 * Based on the current game state data, returns if condition is true.
 * @param data takes in the data to be returned
 * @param game is the pointer to the game model
 * @return the integer value of the game data that has been looked up
 */
private int getData(String data,Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
  if (data.equals(Data.USER_HEALTH.text())) {
    return game.getPlayer(id).getHealth();
  }
 else   if (data.equals(Data.OPPONENT_HEALTH.text())) {
    return game.getPlayer(otherId).getHealth();
  }
 else   if (data.equals(Data.DISTANCE_FROM_OPPONENT.text())) {
    return (int)Math.round(game.distanceToOpponent(id,otherId));
  }
 else {
    try {
      return Integer.parseInt(data);
    }
 catch (    Exception ex) {
      System.out.println("String_Node_Str" + data + "String_Node_Str");
      return -1;
    }
  }
}
Program: 40546
Project: 40546
Buggy source:
/** 
 * Method called to excecute a 'line' of the interpreter.
 * @param game the instance of the game class passed in
 * @param id the id of the player excecuting this script
 * @return true if the command excecuted
 */
public boolean doCommand(Game game,int id){
  for (  Check c : this.checks) {
    if (!c.conditionIsTrue(game)) {
      return false;
    }
  }
  executeFunction(game,id);
  return true;
}

Fixed version (ground truth):
/** 
 * Method called to excecute a 'line' of the interpreter.
 * @param game the instance of the game class passed in
 * @param id the id of the player excecuting this script
 * @return true if the command excecuted
 */
public boolean doCommand(Game game,int id){
  for (  Check c : this.checks) {
    if (!c.conditionIsTrue(game,id)) {
      return false;
    }
  }
  executeFunction(game,id);
  return true;
}
Program: 40547
Project: 40547
Buggy source:
/** 
 * Based on the current game state data, returns if condition is true.
 * @param data takes in the data to be returned
 * @param game is the pointer to the game model
 * @return the integer value of the game data that has been looked up
 */
private int getData(String data,Game game){
  if (data.equals(Data.USER_HEALTH.text())) {
    return game.getPlayer(Game.PLAYER_ID).getHealth();
  }
 else   if (data.equals(Data.OPPONENT_HEALTH.text())) {
    return game.getPlayer(Game.OPPONENT_ID).getHealth();
  }
 else   if (data.equals(Data.DISTANCE_FROM_OPPONENT.text())) {
    return (int)Math.round(game.distanceToOpponent(Game.PLAYER_ID,Game.OPPONENT_ID));
  }
 else {
    try {
      return Integer.parseInt(data);
    }
 catch (    Exception ex) {
      System.out.println("String_Node_Str" + data + "String_Node_Str");
      return -1;
    }
  }
}

Fixed version (ground truth):
/** 
 * Based on the current game state data, returns if condition is true.
 * @param data takes in the data to be returned
 * @param game is the pointer to the game model
 * @return the integer value of the game data that has been looked up
 */
private int getData(String data,Game game){
  if (data.equals(Data.USER_HEALTH.text())) {
    return game.getPlayer(Game.PLAYER_ID).getHealth();
  }
 else   if (data.equals(Data.OPPONENT_HEALTH.text())) {
    return game.getPlayer(Game.OPPONENT_ID).getHealth();
  }
 else   if (data.equals(Data.DISTANCE_FROM_OPPONENT.text())) {
    return game.pathDistanceToPlayer(Game.PLAYER_ID,Game.OPPONENT_ID);
  }
 else {
    try {
      return Integer.parseInt(data);
    }
 catch (    Exception ex) {
      System.out.println("String_Node_Str" + data + "String_Node_Str");
      return -1;
    }
  }
}
Program: 40548
Project: 40548
Buggy source:
/** 
 * Called by doCommand to actually modify the game data with built-in functions
 * @param game the instance of the game class passed in
 * @param id the id of the player executing this script
 */
private void executeFunction(Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
  if (id == 1) {
    System.out.println("String_Node_Str" + id + "String_Node_Str"+ this.command);
  }
switch (this.command) {
case APPROACH:
    game.approach(id,otherId);
  break;
case ATTACK:
game.attack(id);
break;
case HEAL:
game.heal(id,20);
break;
case EVADE:
game.evade(id,otherId);
case DO_NOTHING:
game.doNothing(id);
break;
case DEFEND:
game.defend(id);
break;
default :
game.doNothing(id);
break;
}
}

Fixed version (ground truth):
/** 
 * Called by doCommand to actually modify the game data with built-in functions
 * @param game the instance of the game class passed in
 * @param id the id of the player executing this script
 */
private void executeFunction(Game game,int id){
  int otherId;
  if (id == 0) {
    otherId=1;
  }
 else {
    otherId=0;
  }
  if (id == 1) {
    System.out.println("String_Node_Str" + id + "String_Node_Str"+ this.command);
  }
switch (this.command) {
case APPROACH:
    game.approach(id,otherId);
  break;
case ATTACK:
game.attack(id);
break;
case HEAL:
game.heal(id,9);
break;
case EVADE:
game.evade(id,otherId);
case DO_NOTHING:
game.doNothing(id);
break;
case DEFEND:
game.defend(id);
break;
default :
game.doNothing(id);
break;
}
}
Program: 40549
Project: 40549
Buggy source:
/** 
 * Evades from opposing player.  Will move in direction that is one space away from player.  Will only evade 50% of time
 * @param playerId
 * @param opponentId
 * @return
 */
public boolean evade(int playerId,int opponentId){
  stopDefending(playerId);
  if (getRandomBoolean()) {
    return false;
  }
  Player player=getPlayer(playerId);
  Player opponent=getPlayer(opponentId);
  int currentDistance=pathDistanceToLocation(player.getLocation(),opponent.getLocation());
  ArrayList<Point> potentialMoveLocations=getAllPossibleMoves(getPlayer(playerId).getLocation());
  Point playerCurrentLocation=getPlayer(playerId).getLocation();
  double longestDistance=-1;
  int longestMoveIndex=-1;
  for (int i=0; i < potentialMoveLocations.size(); i++) {
    Point moveLocation=getNewLocation(playerCurrentLocation,potentialMoveLocations.get(i));
    int distanceCandidate=pathDistanceToLocation(moveLocation,opponent.getLocation());
    if (distanceCandidate > longestDistance) {
      longestDistance=distanceCandidate;
      longestMoveIndex=i;
    }
  }
  if (longestDistance > currentDistance) {
    return move(playerId,potentialMoveLocations.get(longestMoveIndex).x,potentialMoveLocations.get(longestMoveIndex).y);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Evades from opposing player.  Will move in direction that is one space away from player.  Will only evade 50% of time
 * @param playerId
 * @param opponentId
 * @return
 */
public boolean evade(int playerId,int opponentId){
  stopDefending(playerId);
  if (getRandomBoolean()) {
    return false;
  }
  Player player=getPlayer(playerId);
  Player opponent=getPlayer(opponentId);
  int currentDistance=pathDistanceToLocation(player.getLocation(),opponent.getLocation());
  ArrayList<Point> potentialMoveLocations=getAllPossibleMoves(getPlayer(playerId).getLocation());
  Point playerCurrentLocation=getPlayer(playerId).getLocation();
  double longestDistance=-1;
  int longestMoveIndex=-1;
  for (int i=0; i < potentialMoveLocations.size(); i++) {
    Point moveLocation=getNewLocation(playerCurrentLocation,potentialMoveLocations.get(i));
    int distanceCandidate=pathDistanceToLocation(moveLocation,opponent.getLocation());
    if (distanceCandidate > longestDistance) {
      longestDistance=distanceCandidate;
      longestMoveIndex=i;
    }
    if (distanceCandidate == longestDistance) {
      if (getRandomBoolean()) {
        longestDistance=distanceCandidate;
        longestMoveIndex=i;
      }
    }
  }
  if (longestDistance > currentDistance) {
    return move(playerId,potentialMoveLocations.get(longestMoveIndex).x,potentialMoveLocations.get(longestMoveIndex).y);
  }
  return false;
}
Program: 40550
Project: 40550
Buggy source:
/** 
 * Number of tiles to get to opponent using only horizontal and vertical movement
 * @param playerId
 * @param opponentId
 * @return
 */
public int pathDistanceToPlayer(int playerId,int opponentId){
  Point distances=getDeltaDistances(playerId,opponentId);
  return (Math.abs(distances.x) + Math.abs(distances.y)) - 1;
}

Fixed version (ground truth):
/** 
 * Number of tiles to get to opponent using only horizontal and vertical movement
 * @param playerId
 * @param opponentId
 * @return
 */
public int pathDistanceToPlayer(int playerId,int opponentId){
  Point distances=getDeltaDistances(playerId,opponentId);
  return Math.abs(distances.x) + Math.abs(distances.y);
}
Program: 40551
Project: 40551
Buggy source:
/** 
 * Moves one tile closer to opponent.
 * @param playerId
 * @param opponentId
 * @return
 */
public boolean approach(int playerId,int opponentId){
  getPlayer(playerId).setShielding(false);
  Point distances=getDeltaDistances(playerId,opponentId);
  if (distances.y == 0) {
    if (distances.x < 0) {
      return move(playerId,DIRECTION_LEFT,DIRECTION_CONSTANT);
    }
 else {
      return move(playerId,DIRECTION_RIGHT,DIRECTION_CONSTANT);
    }
  }
  double slope=(double)distances.x / distances.y;
  if (Math.abs(slope) < .5) {
    if (distances.y < 0) {
      return move(playerId,DIRECTION_CONSTANT,DIRECTION_DOWN);
    }
 else {
      return move(playerId,DIRECTION_CONSTANT,DIRECTION_UP);
    }
  }
 else {
    if (distances.x < 0) {
      return move(playerId,DIRECTION_LEFT,DIRECTION_CONSTANT);
    }
 else {
      return move(playerId,DIRECTION_RIGHT,DIRECTION_CONSTANT);
    }
  }
}

Fixed version (ground truth):
/** 
 * Moves one tile closer to opponent.
 * @param playerId
 * @param opponentId
 * @return
 */
public boolean approach(int playerId,int opponentId){
  stopDefending(playerId);
  Point distances=getDeltaDistances(playerId,opponentId);
  if (distances.y == 0) {
    if (distances.x < 0) {
      return move(playerId,DIRECTION_LEFT,DIRECTION_CONSTANT);
    }
 else {
      return move(playerId,DIRECTION_RIGHT,DIRECTION_CONSTANT);
    }
  }
  double slope=(double)distances.x / distances.y;
  if (Math.abs(slope) < .5) {
    if (distances.y < 0) {
      return move(playerId,DIRECTION_CONSTANT,DIRECTION_DOWN);
    }
 else {
      return move(playerId,DIRECTION_CONSTANT,DIRECTION_UP);
    }
  }
 else {
    if (distances.x < 0) {
      return move(playerId,DIRECTION_LEFT,DIRECTION_CONSTANT);
    }
 else {
      return move(playerId,DIRECTION_RIGHT,DIRECTION_CONSTANT);
    }
  }
}
Program: 40552
Project: 40552
Buggy source:
/** 
 * If opponent is within one tile horizontally or vertically, player will attack that tile.  If not, returns false
 * @param playerId Player
 * @return If player was able to attack
 */
public boolean attack(int playerId){
  if (attackLocation(0,0,1)) {
    return true;
  }
 else   if (attackLocation(0,0,-1)) {
    return true;
  }
 else   if (attackLocation(0,1,0)) {
    return true;
  }
 else   if (attackLocation(0,-1,0)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * If opponent is within one tile horizontally or vertically, player will attack that tile.  If not, returns false
 * @param playerId Player
 * @return If player was able to attack
 */
public boolean attack(int playerId){
  stopDefending(playerId);
  if (attackLocation(0,0,1)) {
    return true;
  }
 else   if (attackLocation(0,0,-1)) {
    return true;
  }
 else   if (attackLocation(0,1,0)) {
    return true;
  }
 else   if (attackLocation(0,-1,0)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 40553
Project: 40553
Buggy source:
/** 
 * Evades from opposing player.  Will move in random direction away from player
 * @param playerId
 * @param opponentId
 * @return
 */
public boolean dodge(int playerId,int opponentId){
  return false;
}

Fixed version (ground truth):
/** 
 * Dodges from opposing player.  Currently not implemented
 * @param playerId
 * @param opponentId
 * @return
 */
public boolean dodge(int playerId,int opponentId){
  stopDefending(playerId);
  return false;
}
Program: 40554
Project: 40554
Buggy source:
/** 
 * Attacks location x and y away from players current location
 * @param playerId Player
 * @param x        Units away from players current location
 * @param y        Units away from players current location
 * @return If player was able to attack
 */
private boolean attackLocation(int playerId,int x,int y){
  EntityTile playerTile=this._entityMap.getPlayers().get(playerId);
  Point location=playerTile.getLocation();
  if (!_entityMap.isInsideMap(new Point(location.x + x,location.y + y))) {
    return false;
  }
  Entity entity=getEntityAtLocation(new Point(location.x + x,location.y + y));
  Player player=(Player)playerTile.getEntity();
  player.setShielding(false);
  if (entity.getEntityType() == Entity.EntityType.EMPTY) {
    return false;
  }
 else {
    Player playerToAttack=(Player)entity;
    int damageToBeDone=player.getDamage();
    if (playerToAttack.isShielding()) {
      damageToBeDone=player.getDamage() - playerToAttack.getShieldStrength();
    }
    playerToAttack.setHealth(playerToAttack.getHealth() - damageToBeDone);
    if (playerToAttack.getHealth() <= HEALTH_DEAD) {
      this._isGameOver=false;
    }
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Attacks location x and y away from players current location
 * @param playerId Player
 * @param x        Units away from players current location
 * @param y        Units away from players current location
 * @return If player was able to attack
 */
private boolean attackLocation(int playerId,int x,int y){
  EntityTile playerTile=this._entityMap.getPlayers().get(playerId);
  Point location=playerTile.getLocation();
  if (!_entityMap.isInsideMap(new Point(location.x + x,location.y + y))) {
    return false;
  }
  Entity entity=getEntityAtLocation(new Point(location.x + x,location.y + y));
  Player player=(Player)playerTile.getEntity();
  player.setShielding(false);
  if (entity.getEntityType() == Entity.EntityType.EMPTY) {
    return false;
  }
 else {
    Player playerToAttack=(Player)entity;
    int damageToBeDone=player.getDamage();
    if (playerToAttack.isShielding()) {
      damageToBeDone=player.getDamage() - playerToAttack.getShieldStrength();
    }
    playerToAttack.setHealth(playerToAttack.getHealth() - damageToBeDone);
    if (playerToAttack.getHealth() <= HEALTH_DEAD) {
      playerToAttack.setHealth(0);
      this._isGameOver=false;
    }
    return true;
  }
}
Program: 40555
Project: 40555
Buggy source:
/** 
 * Used by external classes to acquire game state.
 * @return The GameStatus pertaining to the current state of the game.
 */
public GameStatus getState(){
  if (!isGameOver()) {
    LOGGER.critical("String_Node_Str");
    return GameStatus.RUNNING;
  }
  if (_isStalemate) {
    return GameStatus.STALEMATE;
  }
  LOGGER.warning("String_Node_Str");
  if (isDead(0)) {
    return GameStatus.LOST;
  }
 else   if (isDead(1)) {
    return GameStatus.WON;
  }
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Used by external classes to acquire game state.
 * @return The GameStatus pertaining to the current state of the game.
 */
public GameStatus getState(){
  if (!isGameOver()) {
    return GameStatus.RUNNING;
  }
  if (_isStalemate) {
    return GameStatus.STALEMATE;
  }
  LOGGER.warning("String_Node_Str");
  if (isDead(0)) {
    return GameStatus.LOST;
  }
 else   if (isDead(1)) {
    return GameStatus.WON;
  }
  throw new RuntimeException("String_Node_Str");
}
Program: 40556
Project: 40556
Buggy source:
@Override public void start(Stage primaryStage) throws Exception {
  Parent root=FXMLLoader.load(getClass().getResource("String_Node_Str"));
  primaryStage.setTitle("String_Node_Str");
  primaryStage.setScene(new Scene(root));
  primaryStage.getScene().getStylesheets().add("String_Node_Str");
  primaryStage.setResizable(false);
  primaryStage.show();
}

Fixed version (ground truth):
@Override public void start(Stage primaryStage) throws Exception {
  FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
  Parent root=loader.load();
  primaryStage.setTitle("String_Node_Str");
  primaryStage.setScene(new Scene(root));
  primaryStage.setResizable(false);
  primaryStage.show();
}
Program: 40557
Project: 40557
Buggy source:
private String unixTimeToDays(long unixTimeSec){
  long days=0;
  long hours=0;
  long min=0;
  long sec=0;
  String daysStr="String_Node_Str";
  String hoursStr="String_Node_Str";
  String minStr="String_Node_Str";
  String secStr="String_Node_Str";
  if (unixTimeSec > 86400000) {
    days=unixTimeSec / 86400000;
    days=(int)days;
    daysStr=((days <= 9) ? "String_Node_Str" + String.valueOf(days) : String.valueOf(days));
  }
  if (unixTimeSec % 86400000 > 3600000) {
    hours=(unixTimeSec % 86400000) / 3600000;
    hours=(int)hours;
    hoursStr=((hours <= 9) ? "String_Node_Str" + String.valueOf(hours) : String.valueOf(hours));
  }
  if (((unixTimeSec % 86400000) % 3600000) > 60000) {
    min=((unixTimeSec % 86400000) % 3600000) / 60000;
    min=(int)min;
    minStr=((min <= 9) ? "String_Node_Str" + String.valueOf(min) : String.valueOf(min));
  }
  if ((((unixTimeSec % 86400000) % 3600000) % 60000) > 1000) {
    sec=(((unixTimeSec % 86400000) % 3600000) % 60000) / 1000;
    sec=(int)sec;
    secStr=((sec <= 9) ? "String_Node_Str" + String.valueOf(sec) : String.valueOf(sec));
  }
  return daysStr + "String_Node_Str" + hoursStr+ "String_Node_Str"+ minStr+ "String_Node_Str"+ secStr;
}

Fixed version (ground truth):
private String unixTimeToDays(long unixTimeSec){
  long divReminder=unixTimeSec;
  String result="String_Node_Str";
  int[] dimensionArr={86400000,3600000,60000,1000};
  for (  int dimension : dimensionArr) {
    if (divReminder > dimension) {
      long timeValue=divReminder / dimension;
      timeValue=(int)timeValue;
      String timeValueStr=((timeValue <= 9) ? "String_Node_Str" + String.valueOf(timeValue) : String.valueOf(timeValue));
      result=result + ((dimension == dimensionArr[0]) ? timeValueStr + "String_Node_Str" : (dimension == dimensionArr[3]) ? timeValueStr : timeValueStr + ':');
      divReminder=unixTimeSec % dimension;
    }
 else {
      result=result + ((dimension == dimensionArr[0]) ? "String_Node_Str" : (dimension == dimensionArr[3]) ? "String_Node_Str" : "String_Node_Str");
    }
  }
  return result;
}
Program: 40558
Project: 40558
Buggy source:
public InvestMainItem(String name,String description,String earnedMin,String earnedMax,int stageCurrent,int stageMax,long totalTime,String devAddr,String adrIco,String iconUrl,String icoSymbol){
  this.name=name;
  this.description=description;
  this.earnedMin=earnedMin;
  this.earnedMax=earnedMax;
  this.stageCurrent=stageCurrent;
  this.stageMax=stageMax;
  this.totalTime=totalTime;
  this.devAddr=devAddr;
  this.adrIco=adrIco;
  this.iconUrl=iconUrl;
  this.icoSymbol=icoSymbol;
}

Fixed version (ground truth):
public InvestMainItem(String name,String description,String soldTokens,String icoTotalSupply,int stageCurrent,int stageMax,long totalTime,String devAddr,String adrIco,String iconUrl,String icoSymbol){
  this.name=name;
  this.description=description;
  this.soldTokens=soldTokens;
  this.icoTotalSupply=icoTotalSupply;
  this.stageCurrent=stageCurrent;
  this.stageMax=stageMax;
  this.totalTime=totalTime;
  this.devAddr=devAddr;
  this.adrIco=adrIco;
  this.iconUrl=iconUrl;
  this.icoSymbol=icoSymbol;
}
Program: 40560
Project: 40560
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_ico,container,false);
  bindViews(view);
  attachPresenter();
  getIcoApps();
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_ico,container,false);
  bindViews(view);
  icoRefrashLayout.setOnRefreshListener(this);
  attachPresenter();
  getIcoApps();
  return view;
}
Program: 40561
Project: 40561
Buggy source:
private void bindViews(View view){
  recyclerView=view.findViewById(R.id.recyclerView);
  errorHolder=view.findViewById(R.id.error_holder);
  errorRepeatButton=view.findViewById(R.id.error_view_repeat_btn);
  progressBar=view.findViewById(R.id.progress_bar);
  emptyView=view.findViewById(R.id.empty_view);
  errorRepeatButton.setOnClickListener(v -> presenter.getIcoApps());
}

Fixed version (ground truth):
private void bindViews(View view){
  recyclerView=view.findViewById(R.id.recyclerView);
  errorHolder=view.findViewById(R.id.error_holder);
  errorRepeatButton=view.findViewById(R.id.error_view_repeat_btn);
  progressBar=view.findViewById(R.id.progress_bar);
  emptyView=view.findViewById(R.id.empty_view);
  icoRefrashLayout=view.findViewById(R.id.ico_refresh_layout);
  errorRepeatButton.setOnClickListener(v -> presenter.getIcoApps());
}