nus-yam/ex-repair huggingface dataset:
Program: 154293
Project: 154293
Buggy source:
private void recarregaEnergiaAgente(Agente a){
  a.ganhaEnergia(Constants.PONTO_ENERGIA_ENTREGA_TURNO);
  gastaEnergia(Constants.PONTO_ENERGIA_ENTREGA_TURNO);
  a.recebeuEnergia();
  System.out.println("String_Node_Str" + getId() + "String_Node_Str"+ a);
}

Fixed version (ground truth):
private void recarregaEnergiaAgente(Agente a){
  a.ganhaEnergia(Constants.PONTO_ENERGIA_ENTREGA_TURNO);
  gastaEnergia(Constants.PONTO_ENERGIA_ENTREGA_TURNO);
  a.sinalizaRecebeuEnergia();
  System.out.println("String_Node_Str" + getId() + "String_Node_Str"+ a);
}
Program: 154294
Project: 154294
Buggy source:
private Agente getInimigoJuntoComigo(){
  Agente i=null, retorno=null;
  for (  Entidade a : getArena().getEntidades()) {
    if (a instanceof Agente) {
      i=(Agente)a;
      if (i.getX() == getX() && i.getY() == getY() && isInimigo(i)) {
        retorno=i;
        break;
      }
    }
  }
  return retorno;
}

Fixed version (ground truth):
private Agente getInimigoJuntoComigo(){
  Agente i=null, retorno=null;
  for (  Entidade a : super.getArena().getEntidades()) {
    if (a instanceof Agente) {
      i=(Agente)a;
      if (i.getX() == getX() && i.getY() == getY() && isInimigo(i)) {
        retorno=i;
        break;
      }
    }
  }
  return retorno;
}
Program: 154295
Project: 154295
Buggy source:
private void fazDivisao(){
  fazerDivisao=false;
  if (podeDividir()) {
    gastaEnergia(Constants.ENTIDADE_ENERGIA_GASTO_DIVIDIR);
    gastaEnergia(getEnergia() / 2);
    getArena().divideEntidade(this);
  }
}

Fixed version (ground truth):
private void fazDivisao(){
  fazerDivisao=false;
  if (podeDividir()) {
    gastaEnergia(Constants.ENTIDADE_ENERGIA_GASTO_DIVIDIR);
    gastaEnergia(getEnergia() / 2);
    super.getArena().divideEntidade(this);
  }
}
Program: 154296
Project: 154296
Buggy source:
/** 
 * Envia uma mensagem para os agentes que estão próximos.
 * @param msg string que será enviada como mensagem para os agentes que estão próximos. Todos os agentes que receberem a mensagem terão o método recebeuMensagem() invocado. 
 */
public final void enviaMensagem(String msg){
  Agente d;
  for (  Entidade a : getArena().getEntidades()) {
    if ((a instanceof Agente) && (distancia(a) <= Constants.AGENTE_ALCANCE_MENSAGEM)) {
      d=(Agente)a;
      d.sinalizaRecebeuMensagem(msg,this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Envia uma mensagem para os agentes que estão próximos.
 * @param msg string que será enviada como mensagem para os agentes que estão próximos. Todos os agentes que receberem a mensagem terão o método recebeuMensagem() invocado. 
 */
public final void enviaMensagem(String msg){
  Agente d;
  for (  Entidade a : super.getArena().getEntidades()) {
    if ((a instanceof Agente) && (distancia(a) <= Constants.AGENTE_ALCANCE_MENSAGEM)) {
      d=(Agente)a;
      d.sinalizaRecebeuMensagem(msg,this);
    }
  }
}
Program: 154297
Project: 154297
Buggy source:
/** 
 * Mata um agente instantaneamente (comete suicídio). A energia que o agente carregava é perdida.
 */
public final void morre(){
  if (!avisouMorte) {
    avisouMorte=true;
    getArena().removeEntidade(this);
  }
}

Fixed version (ground truth):
/** 
 * Mata um agente instantaneamente (comete suicídio). A energia que o agente carregava é perdida.
 */
public final void morre(){
  if (!avisouMorte) {
    avisouMorte=true;
    super.getArena().removeEntidade(this);
  }
}
Program: 154298
Project: 154298
Buggy source:
/** 
 * Envia uma mensagem para os agentes que estão próximos.
 * @param msg string que será enviada como mensagem para os agentes que estão próximos. Todos os agentes que receberem a mensagem terão o método recebeuMensagem() invocado. 
 */
public final void enviaMensagem(String msg){
  Agente d;
  for (  Entidade a : super.getArena().getEntidades()) {
    if ((a instanceof Agente) && (distancia(a) <= Constants.AGENTE_ALCANCE_MENSAGEM)) {
      super.getArena().getDesenhista().agenteEnviouMensagem((Agente)a,msg);
      d=(Agente)a;
      d.sinalizaRecebeuMensagem(msg,this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Envia uma mensagem para os agentes que estão próximos.
 * @param msg string que será enviada como mensagem para os agentes que estão próximos. Todos os agentes que receberem a mensagem terão o método recebeuMensagem() invocado. 
 */
public final void enviaMensagem(String msg){
  Agente d;
  for (  Entidade a : super.getArena().getEntidades()) {
    if ((a instanceof Agente) && (((Agente)a).getEquipe() == getEquipe()) && (distancia(a) <= Constants.AGENTE_ALCANCE_MENSAGEM)) {
      super.getArena().getDesenhista().agenteEnviouMensagem((Agente)a,msg);
      d=(Agente)a;
      d.sinalizaRecebeuMensagem(msg,this);
    }
  }
}
Program: 154299
Project: 154299
Buggy source:
private void morrePorErroExcecao(Exception e){
  boolean status=isInfosProtegidas();
  System.out.println("String_Node_Str" + this);
  e.printStackTrace();
  getArena().getDesenhista().agenteMorreuPorExcecao(this,e);
  protegeInformacoes(false);
  morre();
  protegeInformacoes(status);
}

Fixed version (ground truth):
private void morrePorErroExcecao(Exception e){
  boolean status=isInfosProtegidas();
  System.out.println("String_Node_Str" + this);
  e.printStackTrace();
  super.getArena().getDesenhista().agenteMorreuPorExcecao(this,e);
  protegeInformacoes(false);
  morre();
  protegeInformacoes(status);
}
Program: 154300
Project: 154300
Buggy source:
@Override public void onPlayerInteract(PlayerInteractEvent event){
  Action action=event.getAction();
  Player player=event.getPlayer();
  World world=player.getWorld();
  WorldConfig worldConfig=configManager.getWorldConfig(world);
  if (event.hasItem()) {
    if (plugin.hasPermissions(player,"String_Node_Str")) {
      if (worldConfig.lightningEnable) {
        int item=worldConfig.lightningWand;
        int count=worldConfig.lightningCount;
        if (wandManager.hasWandCount(player.getName())) {
          count=wandManager.getWandCount(player.getName());
        }
        if (item != 0) {
          if (event.getItem().getTypeId() == item) {
            Location pos=player.getTargetBlock(null,120).getLocation();
            if ((action == Action.LEFT_CLICK_BLOCK) || (action == Action.LEFT_CLICK_AIR)) {
              for (int i=0; i < count; i++) {
                world.strikeLightning(pos);
              }
            }
 else             if ((action == Action.RIGHT_CLICK_BLOCK) || (action == Action.RIGHT_CLICK_AIR)) {
              for (int i=0; i < count; i++) {
                world.strikeLightningEffect(pos);
              }
            }
          }
        }
      }
 else {
        player.sendMessage(ChatColor.RED + configManager.Lightning_is_disabled);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteract(PlayerInteractEvent event){
  Action action=event.getAction();
  Player player=event.getPlayer();
  World world=player.getWorld();
  WorldConfig worldConfig=configManager.getWorldConfig(world);
  if (event.hasItem()) {
    if (plugin.hasPermissions(player,"String_Node_Str")) {
      int item=worldConfig.lightningWand;
      int count=worldConfig.lightningCount;
      if (wandManager.hasWandCount(player.getName())) {
        count=wandManager.getWandCount(player.getName());
      }
      if (item != 0) {
        if (event.getItem().getTypeId() == item) {
          if (worldConfig.lightningEnable) {
            Location pos=player.getTargetBlock(null,120).getLocation();
            if (action.equals(action.LEFT_CLICK_BLOCK) || action.equals(Action.LEFT_CLICK_AIR)) {
              for (int i=0; i < count; i++) {
                world.strikeLightning(pos);
              }
            }
 else             if (action.equals(Action.RIGHT_CLICK_BLOCK) || action.equals(Action.RIGHT_CLICK_AIR)) {
              for (int i=0; i < count; i++) {
                world.strikeLightningEffect(pos);
              }
            }
          }
 else {
            player.sendMessage(ChatColor.RED + configManager.Lightning_is_disabled);
          }
        }
      }
    }
  }
}
Program: 154301
Project: 154301
Buggy source:
@Override public void onResponseReceived(Request request,Response response){
  System.out.println(response.toString());
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onResponseReceived(Request request,Response response){
  System.out.println(response.toString());
  System.out.println("String_Node_Str");
  popUpPanel.hide();
  createButton.setEnabled(true);
  createButton.setText("String_Node_Str");
  MessageDisplayer.DisplayMessage("String_Node_Str");
}
Program: 154302
Project: 154302
Buggy source:
@SuppressWarnings("String_Node_Str") public static void doPostJson(String url,Json json,RequestCallback requestCallback){
  RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,url);
  if (YapoolGWT.currentSession.getName() == null) {
    Window.alert("String_Node_Str");
  }
  builder.setHeader("String_Node_Str","String_Node_Str");
  try {
    Request response=builder.sendRequest(json.toString(),requestCallback);
  }
 catch (  RequestException e) {
    Window.alert("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void doPostJson(String url,Json json,RequestCallback requestCallback){
  RequestBuilder builder=new RequestBuilder(RequestBuilder.POST,url);
  if (YapoolGWT.currentSession.getName() == null) {
    Window.alert("String_Node_Str");
    return;
  }
  builder.setHeader("String_Node_Str","String_Node_Str");
  try {
    Request response=builder.sendRequest(json.toString(),requestCallback);
  }
 catch (  RequestException e) {
    Window.alert("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}
Program: 154303
Project: 154303
Buggy source:
public void loadSession(String jsonString){
  currentSession=new SessionObject(jsonString);
}

Fixed version (ground truth):
public void loadSession(){
  HttpInterface.doGet("String_Node_Str",new AbstractRequestCallback(){
    @Override public void onResponseReceived(    Request request,    Response response){
      currentSession=new SessionObject(response.getText());
      if (!componentLoaded) {
        loadComponent();
        componentLoaded=true;
      }
      if (currentSession.getName() != null) {
        setSignState(true);
      }
 else {
        setSignState(false);
      }
    }
  }
);
}
Program: 154304
Project: 154304
Buggy source:
/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  HttpInterface.doGet("String_Node_Str",new AbstractRequestCallback(){
    @Override public void onResponseReceived(    Request request,    Response response){
      currentSession=new SessionObject(response.getText());
      loadComponent();
      if (currentSession.getName() != null) {
        setSignState(true);
      }
 else {
        setSignState(false);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  loadSession();
}
Program: 154305
Project: 154305
Buggy source:
@Override public void onResponseReceived(Request request,Response response){
  currentSession=new SessionObject(response.getText());
  loadComponent();
  if (currentSession.getName() != null) {
    setSignState(true);
  }
 else {
    setSignState(false);
  }
}

Fixed version (ground truth):
@Override public void onResponseReceived(Request request,Response response){
  currentSession=new SessionObject(response.getText());
  if (currentSession.getName() != null) {
    signUnit.signIn();
    setSignState(true);
  }
 else {
    signUnit.signOut();
    setSignState(false);
  }
}
Program: 154306
Project: 154306
Buggy source:
@Override public void onResponseReceived(Request request,Response response){
  if (yapoolGWT.getSignState() == false) {
    if (SignRequestCallback.responseIsOk(response)) {
      yapoolGWT.setSignState(true);
    }
 else     if (!SignRequestCallback.responseIsOk(response)) {
      messageLabel.setVisible(true);
      messageLabel.setText(response.getText());
    }
  }
 else   if (yapoolGWT.getSignState() == true) {
    yapoolGWT.setSignState(false);
  }
}

Fixed version (ground truth):
@Override public void onResponseReceived(Request request,Response response){
  System.out.println(response.getText());
  if (yapoolGWT.getSignState() == false) {
    if (SignRequestCallback.responseIsOk(response)) {
      yapoolGWT.reloadSession();
    }
 else     if (!SignRequestCallback.responseIsOk(response)) {
      messageLabel.setVisible(true);
      messageLabel.setText(response.getText());
    }
  }
 else   if (yapoolGWT.getSignState() == true) {
    yapoolGWT.reloadSession();
  }
}
Program: 154308
Project: 154308
Buggy source:
/** 
 * Looks at the board and figures out what move to make. Calls negamax() for each possible move and picks the best one. If there are multiple equally best, it picks one of them at random.
 * @see quoridor.Player#getMove(quoridor.Board)
 */
public Move getMove(Board board){
  assert(this.equals(board.currentPlayer()));
  Board newBoard;
  List<Move> potentialMoves=validMoves(board);
  List<Move> bestMoves=new LinkedList<Move>();
  Collections.sort(potentialMoves,new MinimaxComparator(board.getSpace(board.players.other(this))));
  int bestCase=Integer.MIN_VALUE;
  int evaluation;
  int depth;
  startTime=System.currentTimeMillis();
  for (depth=1; depth <= maxDepth && System.currentTimeMillis() - startTime < timeOut; depth++) {
    for (    Move move : potentialMoves) {
      try {
        newBoard=board.clone();
        newBoard.makeMove(move);
        evaluation=-negamax(newBoard,Integer.MIN_VALUE + 1,Integer.MAX_VALUE,depth - 1);
        move.awesomeness=evaluation;
        if (evaluation > bestCase) {
          bestMoves.clear();
          bestMoves.add(move);
          bestCase=evaluation;
        }
 else         if (evaluation == bestCase) {
          bestMoves.add(move);
        }
      }
 catch (      Exception e) {
      }
    }
    Collections.sort(potentialMoves,new MinimaxComparator());
  }
  int pick=(int)Math.floor(bestMoves.size() * Math.random());
  System.out.println(i);
  i=0;
  return bestMoves.get(pick);
}

Fixed version (ground truth):
/** 
 * Looks at the board and figures out what move to make. Calls negamax() for each possible move and picks the best one. If there are multiple equally best, it picks one of them at random.
 * @see quoridor.Player#getMove(quoridor.Board)
 */
public Move getMove(Board board){
  assert(this.equals(board.currentPlayer()));
  Board newBoard;
  List<Move> potentialMoves=validMoves(board);
  List<Move> bestMoves=new LinkedList<Move>();
  Collections.sort(potentialMoves,new MinimaxComparator(board.getSpace(board.players.other(this))));
  int bestCase=Integer.MIN_VALUE;
  int evaluation;
  int depth;
  startTime=System.currentTimeMillis();
  for (depth=1; depth <= maxDepth && System.currentTimeMillis() - startTime < timeOut; depth++) {
    for (    Move move : potentialMoves) {
      try {
        newBoard=board.clone();
        newBoard.makeMove(move);
        evaluation=-negamax(newBoard,Integer.MIN_VALUE + 1,Integer.MAX_VALUE,depth - 1);
        move.awesomeness=evaluation;
        if (evaluation > bestCase) {
          bestMoves.clear();
          bestMoves.add(move);
          bestCase=evaluation;
        }
 else         if (evaluation == bestCase) {
          bestMoves.add(move);
        }
      }
 catch (      Exception e) {
      }
    }
    Collections.sort(potentialMoves,new MoveComparator());
  }
  int pick=(int)Math.floor(bestMoves.size() * Math.random());
  System.out.println(i);
  i=0;
  return bestMoves.get(pick);
}
Program: 154310
Project: 154310
Buggy source:
/** 
 * Looks at the board and figures out what move to make. Calls negamax() for each possible move and picks the best one. If there are multiple equally best, it picks one of them at random.
 * @see quoridor.Player#getMove(quoridor.Board)
 */
public Move getMove(Board board){
  assert(this.equals(board.currentPlayer()));
  Board newBoard;
  List<Move> potentialMoves=allMoves(board);
  List<Move> bestMoves=new LinkedList<Move>();
  Collections.sort(potentialMoves,new MinimaxComparator(board.getSpace(board.players.other(this))));
  int bestCase=Integer.MIN_VALUE;
  int evaluation;
  for (  Move move : potentialMoves) {
    try {
      newBoard=board.clone();
      newBoard.makeMove(move);
      evaluation=-negamax(newBoard,Integer.MIN_VALUE,Integer.MAX_VALUE,depth);
      if (evaluation > bestCase) {
        bestMoves.clear();
        bestMoves.add(move);
        bestCase=evaluation;
      }
 else       if (evaluation == bestCase) {
        bestMoves.add(move);
      }
    }
 catch (    Exception e) {
    }
  }
  int pick=(int)Math.floor(bestMoves.size() * Math.random());
  System.out.println(i);
  i=0;
  return bestMoves.get(pick);
}

Fixed version (ground truth):
/** 
 * Looks at the board and figures out what move to make. Calls negamax() for each possible move and picks the best one. If there are multiple equally best, it picks one of them at random.
 * @see quoridor.Player#getMove(quoridor.Board)
 */
public Move getMove(Board board){
  assert(this.equals(board.currentPlayer()));
  Board newBoard;
  List<Move> potentialMoves=allMoves(board);
  List<Move> bestMoves=new LinkedList<Move>();
  Collections.sort(potentialMoves,new MinimaxComparator(board.getSpace(board.players.other(this))));
  int bestCase=Integer.MIN_VALUE;
  int evaluation;
  for (  Move move : potentialMoves) {
    try {
      newBoard=board.clone();
      newBoard.makeMove(move);
      evaluation=-negamax(newBoard,Integer.MIN_VALUE + 1,Integer.MAX_VALUE,depth);
      if (evaluation > bestCase) {
        bestMoves.clear();
        bestMoves.add(move);
        bestCase=evaluation;
      }
 else       if (evaluation == bestCase) {
        bestMoves.add(move);
      }
    }
 catch (    Exception e) {
    }
  }
  int pick=(int)Math.floor(bestMoves.size() * Math.random());
  i=0;
  return bestMoves.get(pick);
}
Program: 154311
Project: 154311
Buggy source:
/** 
 * Does the actual moving back to the previous state. 
 */
public void undoLastMove(){
  Move move=moveList.get(moveListIndex);
  if (move instanceof MovementMove) {
    setSpace(move.owner,((MovementMove)move).from());
  }
 else   if (move instanceof WallMove) {
    this.removeWall(((WallMove)move).wall());
  }
  currentPlayer=players.other(currentPlayer);
  moveListIndex--;
}

Fixed version (ground truth):
/** 
 * Does the actual moving back to the previous state. 
 */
public void undoLastMove(){
  Move move=moveList.get(moveListIndex);
  currentPlayer=players.other(currentPlayer);
  if (move instanceof MovementMove) {
    setSpace(move.owner,((MovementMove)move).from());
  }
 else   if (move instanceof WallMove) {
    this.removeWall(((WallMove)move).wall());
  }
  moveListIndex--;
}
Program: 154312
Project: 154312
Buggy source:
@Override protected int wallsLeftWeight(){
  return 2;
}

Fixed version (ground truth):
@Override protected int wallsLeftWeight(){
  return 3;
}
Program: 154313
Project: 154313
Buggy source:
private int negamax(Board board,int alpha,int beta,int depth){
  i++;
  if (board.currentPlayer().equals(board.winner()))   return Integer.MAX_VALUE;
 else   if (board.players.other(board.currentPlayer()).equals(board.winner()))   return Integer.MIN_VALUE;
 else   if (depth == 0)   return board.currentPlayer().minMax() * evaluate(board);
  Board newBoard;
  List<Move> potentialMoves=board.currentPlayer().allMoves(board);
  int bestCase=Integer.MIN_VALUE;
  int evaluation;
  for (  Move move : potentialMoves) {
    try {
      newBoard=board.clone();
      newBoard.makeMove(move);
      evaluation=-negamax(newBoard,-beta,-alpha,depth - 1);
      if (evaluation > bestCase)       bestCase=evaluation;
      if (bestCase > alpha)       alpha=bestCase;
      if (alpha >= beta)       return alpha;
    }
 catch (    Exception e) {
    }
  }
  return bestCase;
}

Fixed version (ground truth):
private int negamax(Board board,int alpha,int beta,int depth){
  i++;
  if (board.currentPlayer().equals(board.winner()))   return Integer.MAX_VALUE;
 else   if (board.players.other(board.currentPlayer()).equals(board.winner()))   return Integer.MIN_VALUE + 1;
 else   if (depth == 0)   return board.currentPlayer().minMax() * evaluate(board);
  Board newBoard;
  List<Move> potentialMoves=board.currentPlayer().allMoves(board);
  int bestCase=Integer.MIN_VALUE;
  int evaluation;
  for (  Move move : potentialMoves) {
    try {
      newBoard=board.clone();
      newBoard.makeMove(move);
      evaluation=-negamax(newBoard,-beta,-alpha,depth - 1);
      if (evaluation > bestCase)       bestCase=evaluation;
      if (bestCase > alpha)       alpha=bestCase;
      if (alpha >= beta)       return alpha;
    }
 catch (    Exception e) {
    }
  }
  return bestCase;
}
Program: 154315
Project: 154315
Buggy source:
/** 
 * Checks whether a placed wall will cut off the path.
 * @param wall
 * @return
 */
private boolean cutsOffPath(WallMove move){
  boolean blocks=false;
  int i;
  addWall(move.wall());
  ArrayList<Space> exits=new ArrayList<Space>();
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player2Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(getSpace(players._1())) == -1)   blocks=true;
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player1Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(getSpace(players._2())) == -1)   blocks=true;
  removeWall(move.wall());
  return blocks;
}

Fixed version (ground truth):
/** 
 * Checks whether a placed wall will cut off the path.
 * @param wall
 * @return
 */
private boolean cutsOffPath(WallMove move){
  boolean blocks=false;
  int i;
  addWall(move.wall());
  ArrayList<Space> exits=new ArrayList<Space>();
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player2Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(getSpace(players._1())) == -1)   blocks=true;
  exits.clear();
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player1Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(getSpace(players._2())) == -1)   blocks=true;
  removeWall(move.wall());
  return blocks;
}
Program: 154316
Project: 154316
Buggy source:
/** 
 * Checks whether a placed wall will cut off the path.
 * @param wall
 * @return TODO: Implementation
 */
private boolean cutsOffPath(WallMove move){
  boolean blocks=false;
  int i;
  addWall(move.wall());
  ArrayList<Space> exits=new ArrayList<Space>();
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player2Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(players._1().getSpace()) == -1)   blocks=true;
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player1Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(players._2().getSpace()) == -1)   blocks=true;
  return blocks;
}

Fixed version (ground truth):
/** 
 * Checks whether a placed wall will cut off the path.
 * @param wall
 * @return TODO: Implementation
 */
private boolean cutsOffPath(WallMove move){
  boolean blocks=false;
  int i;
  addWall(move.wall());
  ArrayList<Space> exits=new ArrayList<Space>();
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player2Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(players._1().getSpace()) == -1)   blocks=true;
  for (i=1; i <= 9; i++)   exits.add(new Space(i,player1Start.row()));
  graph.fillNodeDistances(exits);
  if (graph.getDist(players._2().getSpace()) == -1)   blocks=true;
  removeWall(move.wall());
  return blocks;
}
Program: 154317
Project: 154317
Buggy source:
/** 
 * Check that a move is valid with respect to the current board state.
 * @param move
 * @return True if the move is valid.TODO: Make it throw exceptions for invalid moves.
 */
private boolean moveValid(Move move){
  if (move instanceof MovementMove) {
    MovementMove mMove=(MovementMove)move;
    if (!wallIsHere(mMove.from(),mMove.to()) && mMove.from().equals(currentPlayer.getSpace()) && !isOccupied(mMove.to())&& (adjacentSpaces(mMove.from(),mMove.to()) || jumpValid(mMove))) {
      return true;
    }
    return false;
  }
  if (move instanceof WallMove) {
    if (!currentPlayer.hasWallsLeft()) {
      return false;
    }
    WallMove wMove=(WallMove)move;
    Wall proposedWall=wMove.wall();
    if (proposedWall.isHorizontal() && !wallIsHere(proposedWall.getSpace(),proposedWall.getSpace().getDown())) {
      return true;
    }
 else     if (!proposedWall.isHorizontal() && !wallIsHere(proposedWall.getSpace(),proposedWall.getSpace().getRight())) {
      if (cutsOffPath((WallMove)move))       return false;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check that a move is valid with respect to the current board state.
 * @param move
 * @return True if the move is valid.TODO: Make it throw exceptions for invalid moves.
 */
private boolean moveValid(Move move){
  if (move instanceof MovementMove) {
    MovementMove mMove=(MovementMove)move;
    if (!wallIsHere(mMove.from(),mMove.to()) && mMove.from().equals(currentPlayer.getSpace()) && !isOccupied(mMove.to())&& (adjacentSpaces(mMove.from(),mMove.to()) || jumpValid(mMove))) {
      return true;
    }
    return false;
  }
  if (move instanceof WallMove) {
    if (!currentPlayer.hasWallsLeft()) {
      return false;
    }
    WallMove wMove=(WallMove)move;
    Wall proposedWall=wMove.wall();
    if (wallList.contains(new Wall(wMove.wall().getSpace(),!wMove.wall().isVertical())))     return false;
    if (proposedWall.isHorizontal() && !wallIsHere(proposedWall.getSpace(),proposedWall.getSpace().getDown()) && !wallIsHere(proposedWall.getSpace().getRight(),proposedWall.getSpace().getDown().getRight())) {
      if (cutsOffPath((WallMove)move))       return false;
      return true;
    }
 else     if (!proposedWall.isHorizontal() && !wallIsHere(proposedWall.getSpace(),proposedWall.getSpace().getRight()) && !wallIsHere(proposedWall.getSpace().getDown(),proposedWall.getSpace().getRight().getDown())) {
      if (cutsOffPath((WallMove)move))       return false;
      return true;
    }
  }
  return false;
}
Program: 154318
Project: 154318
Buggy source:
public int getDist(Space space){
  return node[space.row()][space.col()].distanceToExit;
}

Fixed version (ground truth):
public int getDist(Space space){
  return node[space.row() - 1][space.col() - 1].distanceToExit;
}
Program: 154319
Project: 154319
Buggy source:
public boolean makeMoveFromInput(String moveInput){
  Move move;
  if (moveInput.length() == MOVEMENT_MOVE) {
    try {
      move=new MovementMove(this.currentPlayer.getSpace(),new Space(moveInput));
      move.owner=currentPlayer;
    }
 catch (    Exception e) {
      return false;
    }
  }
 else   if (moveInput.length() == WALL_MOVE && moveInput.substring(2).toLowerCase() == "String_Node_Str" && moveInput.substring(2).toLowerCase() == "String_Node_Str") {
    try {
      move=new WallMove(new Wall(moveInput));
      move.owner=currentPlayer;
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
  return this.makeMove(move);
}

Fixed version (ground truth):
public boolean makeMoveFromInput(String moveInput){
  Move move;
  if (moveInput.length() == MOVEMENT_MOVE) {
    try {
      move=new MovementMove(this.currentPlayer.getSpace(),new Space(moveInput));
      move.owner=currentPlayer;
    }
 catch (    Exception e) {
      return false;
    }
  }
 else   if (moveInput.length() == WALL_MOVE && (moveInput.substring(2).equalsIgnoreCase("String_Node_Str") || moveInput.substring(2).equalsIgnoreCase("String_Node_Str"))) {
    try {
      move=new WallMove(new Wall(moveInput));
      move.owner=currentPlayer;
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
  return this.makeMove(move);
}
Program: 154320
Project: 154320
Buggy source:
/** 
 * Undo the last move.	 
 */
public void undo(){
  if (moveListIndex < 0)   return;
  Move move=moveList.get(moveListIndex);
  if (move instanceof MovementMove) {
    move.owner.setSpace(((MovementMove)move).from());
  }
  if (move instanceof WallMove) {
    this.removeWall(((WallMove)move).wall());
  }
  moveListIndex--;
}

Fixed version (ground truth):
/** 
 * Undo the last move.	 
 */
public void undo(){
  if (moveListIndex < 0)   return;
  Move move=moveList.get(moveListIndex);
  if (move instanceof MovementMove) {
    move.owner.setSpace(((MovementMove)move).from());
  }
  if (move instanceof WallMove) {
    this.removeWall(((WallMove)move).wall());
  }
  currentPlayer=players.other(currentPlayer);
  moveListIndex--;
}
Program: 154321
Project: 154321
Buggy source:
/** 
 * Updates the board state with the move. Assumes that the move is valid. Used for new (validated) moves or redo.
 * @param move to be played
 */
private void applyMove(Move move){
  if (move instanceof MovementMove) {
    move.owner.setSpace(((MovementMove)move).to());
  }
  if (move instanceof WallMove) {
    this.addWall(((WallMove)move).wall());
  }
}

Fixed version (ground truth):
/** 
 * Updates the board state with the move. Assumes that the move is valid. Used for new (validated) moves or redo.
 * @param move to be played
 */
private void applyMove(Move move){
  if (move instanceof MovementMove) {
    move.owner.setSpace(((MovementMove)move).to());
  }
  if (move instanceof WallMove) {
    this.addWall(((WallMove)move).wall());
  }
  currentPlayer=players.other(currentPlayer);
}
Program: 154322
Project: 154322
Buggy source:
/** 
 * Checks if a wall exists between two given spaces.
 * @param space a, b the spaces that represent the junction being queried
 * @return true if a wall exists between these two walls.
 */
public boolean wallIsHere(Space a,Space b){
  if (!(adjacentSpaces(a,b))) {
    return false;
  }
  if ((b.col() < a.col()) || (b.row() < a.row())) {
    Space temp=a;
    a=b;
    b=temp;
  }
  LinkedList<Wall> toConsider=new LinkedList<Wall>();
  if (b.equals(a.getRight())) {
    toConsider.add(new Wall(a,true));
    if (a.getUp() != null) {
      toConsider.add(new Wall(a.getUp(),true));
    }
  }
  if (b.equals(a.getDown())) {
    toConsider.add(new Wall(a,false));
    if (a.getLeft() != null) {
      toConsider.add(new Wall(a.getLeft(),false));
    }
  }
  while (toConsider != null) {
    if (wallList.contains(toConsider.remove())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks if a wall exists between two given spaces.
 * @param space a, b the spaces that represent the junction being queried
 * @return true if a wall exists between these two walls.
 */
public boolean wallIsHere(Space a,Space b){
  if (!(adjacentSpaces(a,b))) {
    return false;
  }
  if ((b.col() < a.col()) || (b.row() < a.row())) {
    Space temp=a;
    a=b;
    b=temp;
  }
  LinkedList<Wall> toConsider=new LinkedList<Wall>();
  if (b.equals(a.getRight())) {
    if (a.getDown() != null)     toConsider.add(new Wall(a,true));
    if (a.getUp() != null)     toConsider.add(new Wall(a.getUp(),true));
  }
  if (b.equals(a.getDown())) {
    if (a.getRight() != null)     toConsider.add(new Wall(a,false));
    if (a.getLeft() != null)     toConsider.add(new Wall(a.getLeft(),false));
  }
  while (toConsider.size() > 0) {
    if (wallList.contains(toConsider.remove())) {
      return true;
    }
  }
  return false;
}
Program: 154323
Project: 154323
Buggy source:
/** 
 * this function controls the flow of game play.
 */
public boolean playGame(){
  while (!gameOver) {
    System.out.println(board);
    if (playNextTurn() == INVALID_INPUT) {
      return false;
    }
  }
  return gameOver;
}

Fixed version (ground truth):
/** 
 * This function controls the flow of game play.
 */
public boolean playGame(){
  while (!gameOver) {
    System.out.println(board);
    if (playNextTurn() == INVALID_INPUT) {
      if (validatorGame)       return false;
 else       System.out.println("String_Node_Str");
    }
  }
  return gameOver;
}
Program: 154324
Project: 154324
Buggy source:
/** 
 * Constructor for a default player
 * @param playerNumber can be of value 1 or 2 - for default filling of fields: name, token. 
 */
public Player(int playerNumber){
  if (playerNumber == 1) {
    name="String_Node_Str";
    this.space=new Space("String_Node_Str");
  }
 else {
    name="String_Node_Str";
    this.space=new Space("String_Node_Str");
  }
  setToken(name);
}

Fixed version (ground truth):
/** 
 * Constructor for a default player
 * @param playerNumber can be of value 1 or 2 - for default filling of fields: name, token. 
 */
public Player(int playerNumber){
  if (playerNumber == 1) {
    name="String_Node_Str";
    token="String_Node_Str";
    this.space=new Space("String_Node_Str");
  }
 else   if (playerNumber == 2) {
    token="String_Node_Str";
    name="String_Node_Str";
    this.space=new Space("String_Node_Str");
  }
 else   throw new RuntimeException("String_Node_Str");
}
Program: 154325
Project: 154325
Buggy source:
protected void setToken(String t){
  this.token=t;
}

Fixed version (ground truth):
protected void setToken(String t){
  if (t.length() == 0)   return;
 else   if (t.length() == 1)   token="String_Node_Str" + t + "String_Node_Str";
 else   if (t.length() == 2)   token=t + "String_Node_Str";
 else   if (t.length() == 3)   token=t;
 else   token=t.substring(0,3);
}
Program: 154326
Project: 154326
Buggy source:
/** 
 * obtain the space below
 * @return space below this object
 */
public Space getDown(){
  if (row == 1) {
    return null;
  }
  return new Space(col,row - 1);
}

Fixed version (ground truth):
/** 
 * obtain the space below
 * @return space below this object
 */
public Space getDown(){
  if (row == 9) {
    return null;
  }
  return new Space(col,row + 1);
}
Program: 154327
Project: 154327
Buggy source:
/** 
 * obtain the space above
 * @return space above this object
 */
public Space getUp(){
  if (row == 9) {
    return null;
  }
  return new Space(col,row + 1);
}

Fixed version (ground truth):
/** 
 * obtain the space above
 * @return space above this object
 */
public Space getUp(){
  if (row == 1) {
    return null;
  }
  return new Space(col,row - 1);
}
Program: 154328
Project: 154328
Buggy source:
/** 
 */
public Wall(String command){
  assert(command.length() == VALID_INPUT);
  String wallType=command.toLowerCase().substring(WALL_TYPE);
  if (wallType.equals("String_Node_Str")) {
    this.vertical=false;
  }
 else   if (wallType.equals("String_Node_Str")) {
    this.vertical=true;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  Space space=new Space(command.substring(FIRST_CHAR,SECOND_CHAR));
  if (!validWall(space)) {
    throw new RuntimeException("String_Node_Str");
  }
 else {
    this.space=space;
  }
}

Fixed version (ground truth):
/** 
 */
public Wall(String command){
  assert(command.length() == VALID_INPUT);
  String wallType=command.toLowerCase().substring(WALL_TYPE);
  if (wallType.equalsIgnoreCase("String_Node_Str")) {
    this.vertical=false;
  }
 else   if (wallType.equalsIgnoreCase("String_Node_Str")) {
    this.vertical=true;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  Space space=new Space(command.substring(FIRST_CHAR,THIRD_CHAR));
  if (!validWall(space)) {
    throw new RuntimeException("String_Node_Str");
  }
 else {
    this.space=space;
  }
}
Program: 154329
Project: 154329
Buggy source:
public boolean checkWin(){
  Player player1=players._1();
  Player player2=players._2();
  if (player1.getSpace().equals(player2Start)) {
    winner=player1;
    return true;
  }
 else   if (player2.getSpace().equals(player1Start)) {
    winner=player2;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean checkWin(){
  Player player1=players._1();
  Player player2=players._2();
  if (player1.getSpace().row() == player2Start.row()) {
    winner=player1;
    return true;
  }
 else   if (player2.getSpace().row() == player1Start.row()) {
    winner=player2;
    return true;
  }
  return false;
}
Program: 154330
Project: 154330
Buggy source:
/** 
 * Check that a move is valid with respect to the current board state.
 * @param move
 * @return True if the move is valid.TODO: Make it throw exceptions for invalid moves.
 */
private boolean moveValid(Move move){
  if (move instanceof MovementMove) {
    MovementMove mMove=(MovementMove)move;
    if (!mMove.from().equals(currentPlayer.getSpace()))     return false;
    if (mMove.to().equals(players.other(currentPlayer).getSpace()))     return false;
    if (mMove.isJump()) {
    }
 else {
      if (wallIsHere(mMove.from(),mMove.to()))       return false;
      return true;
    }
  }
  if (move instanceof WallMove) {
    WallMove wMove=(WallMove)move;
    if (existingWall(wMove.wall()))     return false;
    if (wallOverLap(wMove.wall()))     return false;
    if (cutsOffPath(wMove.wall()))     return false;
    if (wallList.size() >= 20)     return false;
    return true;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check that a move is valid with respect to the current board state.
 * @param move
 * @return True if the move is valid.TODO: Make it throw exceptions for invalid moves.
 */
private boolean moveValid(Move move){
  if (move instanceof MovementMove) {
    MovementMove mMove=(MovementMove)move;
    if (!mMove.from().equals(currentPlayer.getSpace()))     return false;
    if (isOccupied(mMove.to()))     return false;
    if (mMove.isJump()) {
    }
 else {
      if (wallIsHere(mMove.from(),mMove.to()))       return false;
      return true;
    }
  }
  if (move instanceof WallMove) {
    WallMove wMove=(WallMove)move;
    if (existingWall(wMove.wall()))     return false;
    if (wallOverLap(wMove.wall()))     return false;
    if (cutsOffPath(wMove.wall()))     return false;
    if (wallList.size() >= 20)     return false;
    return true;
  }
  return true;
}
Program: 154331
Project: 154331
Buggy source:
/** 
 * Checks that the move is a potentially valid quoridor move. This does NOT guarantee that the move is valid in the current game state. Also checks whether the move is a jump move.
 * @param from The Space moved from.
 * @param to The Space moved to.
 * @return True if move is valid.
 */
private boolean validate(Space from,Space to){
  if (!from.equals(to))   return false;
  if (Math.abs(from.row() - to.row()) <= 1 && Math.abs(from.col() - to.col()) <= 1) {
    if (from.row() == to.row() || from.col() == to.col())     isJump=false;
 else     isJump=true;
    return true;
  }
  if (from.row() == to.row() && Math.abs(from.col() - to.col()) == 2 || from.col() == to.col() && Math.abs(from.row() - to.row()) == 2) {
    isJump=true;
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks that the move is a potentially valid quoridor move. This does NOT guarantee that the move is valid in the current game state. Also checks whether the move is a jump move.
 * @param from The Space moved from.
 * @param to The Space moved to.
 * @return True if move is valid.
 */
private boolean validate(Space from,Space to){
  if (from.equals(to))   return false;
  if (Math.abs(from.row() - to.row()) <= 1 && Math.abs(from.col() - to.col()) <= 1) {
    if (from.row() == to.row() || from.col() == to.col())     isJump=false;
 else     isJump=true;
    return true;
  }
  if (from.row() == to.row() && Math.abs(from.col() - to.col()) == 2 || from.col() == to.col() && Math.abs(from.row() - to.row()) == 2) {
    isJump=true;
    return true;
  }
  return false;
}
Program: 154332
Project: 154332
Buggy source:
/** 
 * Adds an individual wall to the boards list, by constructing a new wall and appending it to the list. 
 * @param x the walls x coordinate as an int.
 * @param y the walls y coordinate as an int.
 * @param vertical if the wall is vertical or not, as a boolean. 
 */
public void addWall(int x,int y,Boolean vertical){
  wallList.add(new Wall(x,y,vertical));
}

Fixed version (ground truth):
/** 
 * Adds an individual wall to the boards list, by constructing a new wall and appending it to the list. 
 * @param x the walls x coordinate as an int.
 * @param y the walls y coordinate as an int.
 * @param vertical if the wall is vertical or not, as a boolean. 
 */
public void addWall(int x,int y,Boolean vertical){
  wallList.add(new Wall(new Space(x,y),vertical));
}
Program: 154333
Project: 154333
Buggy source:
/** 
 * A board takes Two players as a pair as defined by the Two Class.
 * @param players The Two players for the this board instance.
 */
public Board(Two<Player> players){
  this.players=players;
  wallList=new LinkedList<Wall>();
}

Fixed version (ground truth):
/** 
 * A board takes Two players as a pair as defined by the Two Class.
 * @param players The Two players for the this board instance.
 */
public Board(String player1Name,String player2Name){
  Player player1=new Player(player1Name,player1Start,"String_Node_Str");
  Player player2=new Player(player2Name,player2Start,"String_Node_Str");
  this.players=new Two<Player>(player1,player2);
  wallList=new LinkedList<Wall>();
}
Program: 154335
Project: 154335
Buggy source:
void setupGame(){
}

Fixed version (ground truth):
void setupGame(){
  System.out.println("String_Node_Str");
  System.out.print("String_Node_Str");
  String player1Name=getFromUser();
  System.out.print("String_Node_Str");
  String player2Name=getFromUser();
  board=new Board(player1Name,player2Name);
  currentPlayer=board.getPlayers()._1();
}
Program: 154336
Project: 154336
Buggy source:
@Override public void update(Observable o,Object arg){
  LogEvent le=(LogEvent)arg;
  Tools.print(le.toString() + "String_Node_Str" + le.getDetails());
}

Fixed version (ground truth):
@Override public void update(Observable o,Object arg){
}
Program: 154337
Project: 154337
Buggy source:
/** 
 * The Constructor
 */
public EduTLS(){
  super("String_Node_Str");
  SYSTEM_START=System.currentTimeMillis();
  setSize(800,600);
  setResizable(false);
  setVisible(true);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  getContentPane().setLayout(null);
  Log.get().addObserver(this);
  initializeComponents();
}

Fixed version (ground truth):
/** 
 * The Constructor
 */
public EduTLS(){
  super("String_Node_Str");
  SYSTEM_START=System.currentTimeMillis();
  setSize(800,600);
  setResizable(false);
  setVisible(true);
  setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  addWindowListener(new ClosingAdapter());
  getContentPane().setLayout(null);
  Log.get().addObserver(this);
  initializeComponents();
}
Program: 154338
Project: 154338
Buggy source:
public void close(){
  listen=false;
  try {
    Tools.printerr("String_Node_Str");
    if (server != null && !server.isClosed())     server.close();
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void close(){
  listen=false;
  try {
    Tools.printerr("String_Node_Str");
    if (server != null && !server.isClosed())     server.close();
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str");
  }
}
Program: 154340
Project: 154340
Buggy source:
/** 
 * The Constructor
 */
public EduTLS(){
  super("String_Node_Str");
  SYSTEM_START=System.currentTimeMillis();
  setSize(800,600);
  setResizable(false);
  setVisible(true);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  getContentPane().setLayout(null);
  logevents=new ArrayList<LogEvent>();
  Log.get().addObserver(this);
  initializeComponents();
  initializeActionListeners();
}

Fixed version (ground truth):
/** 
 * The Constructor
 */
public EduTLS(){
  super("String_Node_Str");
  SYSTEM_START=System.currentTimeMillis();
  setSize(800,600);
  setResizable(true);
  setVisible(true);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  getContentPane().setLayout(null);
  logevents=new ArrayList<LogEvent>();
  Log.get().addObserver(this);
  initializeComponents();
  initializeActionListeners();
}
Program: 154341
Project: 154341
Buggy source:
@Override public TLSRecord read(State state){
  TLSRecord record;
  byte[] b=new byte[TLSEngine.RECORD_SIZE];
  byte[] tmp, input;
  int size=0;
  try {
    size=is.read(b);
    if (size > 0) {
      input=new byte[size];
      Tools.byteCopy(b,input);
      int contentSize=(int)(input[2] & 0xFF) * 256 + (int)(input[3] & 0xFF);
      if (contentSize == (size - TLSEngine.HEADER_SIZE)) {
        try {
          record=new TLSRecord(state,input);
          return record;
        }
 catch (        AlertException e) {
          Tools.printerr(e.getAlertDescription());
        }
      }
 else {
        Tools.printerr("String_Node_Str" + contentSize + "String_Node_Str"+ size+ "String_Node_Str"+ Tools.byteArrayToString(input));
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public TLSRecord read(State state){
  TLSRecord record;
  byte[] b=new byte[TLSEngine.RECORD_SIZE];
  byte[] tmp, input;
  int size=0;
  try {
    if (!isConnected())     reconnect();
    size=is.read(b);
    if (size > 0) {
      input=new byte[size];
      Tools.byteCopy(b,input);
      int contentSize=(int)(input[2] & 0xFF) * 256 + (int)(input[3] & 0xFF);
      if (contentSize == (size - TLSEngine.HEADER_SIZE)) {
        try {
          record=new TLSRecord(state,input);
          return record;
        }
 catch (        AlertException e) {
          Tools.printerr(e.getAlertDescription());
        }
      }
 else {
        Tools.printerr("String_Node_Str" + contentSize + "String_Node_Str"+ size+ "String_Node_Str"+ Tools.byteArrayToString(input));
      }
    }
  }
 catch (  IOException e) {
    Tools.print("String_Node_Str");
    e.printStackTrace();
  }
  return null;
}
Program: 154342
Project: 154342
Buggy source:
@Override public synchronized void write(TLSRecord record){
  try {
    os.write(record.getCiphertext());
    os.flush();
    Thread.sleep(80);
  }
 catch (  IOException e) {
    Tools.printerr("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    Tools.printerr("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public synchronized void write(TLSRecord record){
  try {
    if (!isConnected())     reconnect();
    os.write(record.getCiphertext());
    os.flush();
    Thread.sleep(100);
  }
 catch (  IOException e) {
    Tools.printerr("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    Tools.printerr("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
}
Program: 154343
Project: 154343
Buggy source:
public AlertException(int level,int code,String description){
  super(description);
  this.alertDescription=description;
  this.alertLevel=level;
  this.alertCode=code;
  Log.get().add(new LogEvent("String_Node_Str",description));
}

Fixed version (ground truth):
public AlertException(int level,int code,String description){
  super(description);
  this.alertDescription=description;
  this.alertLevel=level;
  this.alertCode=code;
  String caller=Thread.currentThread().getStackTrace()[2].getClassName() + "String_Node_Str" + Thread.currentThread().getStackTrace()[2].getLineNumber();
  Log.get().add(new LogEvent("String_Node_Str",description + "String_Node_Str" + caller+ "String_Node_Str"));
}
Program: 154344
Project: 154344
Buggy source:
public String getHandshakeLog(){
  return handshakeLog.toString();
}

Fixed version (ground truth):
public String getHandshakeLog(){
  String tmp=handshakeLog.toString();
  handshakeLog=new StringBuilder();
  return tmp;
}