nus-yam/ex-repair huggingface dataset:
Program: 181093
Project: 181093
Buggy source:
/** 
 * Checks if there is a wall between two given adjacent squares
 * @param a one of the squares
 * @param b the other square
 * @return True if there is a wall between the two squares
 */
private boolean wallBetween(Square a,Square b){
  assert(a.getRow() == b.getRow() || a.getCol() == b.getCol());
  Square topLeftMost;
  Square other;
  Pair<Square> topLeftCandidate;
  boolean wallDirection;
  Pair<Wall> candidateWalls;
  if (a.getRow() == b.getRow()) {
    assert(Math.abs(a.getCol() - b.getCol()) == 1);
    if (a.getCol() < b.getCol()) {
      topLeftMost=a;
    }
 else {
      topLeftMost=b;
    }
    wallDirection=Wall.VERTICAL;
    other=new SquareImpl(topLeftMost.getCol(),topLeftMost.getRow() + 1);
  }
 else {
    assert(Math.abs(a.getRow() - b.getRow()) == 1);
    if (a.getRow() > b.getRow()) {
      topLeftMost=a;
    }
 else {
      topLeftMost=b;
    }
    wallDirection=Wall.HORIZONTAL;
    other=new SquareImpl(topLeftMost.getCol() - 1,topLeftMost.getRow());
  }
  topLeftCandidate=new PairImpl<Square>(topLeftMost,other);
  candidateWalls=new PairImpl<Wall>(new WallImpl(topLeftCandidate._1(),wallDirection),new WallImpl(topLeftCandidate._2(),wallDirection));
  return walls.contains(candidateWalls._1()) || walls.contains(candidateWalls._2());
}

Fixed version (ground truth):
/** 
 * Checks if there is a wall between two given adjacent squares
 * @param a one of the squares
 * @param b the other square
 * @return True if there is a wall between the two squares
 */
public boolean wallBetween(Square a,Square b){
  assert(a.getRow() == b.getRow() || a.getCol() == b.getCol());
  Square topLeftMost;
  Square other;
  Pair<Square> topLeftCandidate;
  boolean wallDirection;
  Pair<Wall> candidateWalls;
  if (a.getRow() == b.getRow()) {
    assert(Math.abs(a.getCol() - b.getCol()) == 1);
    if (a.getCol() < b.getCol()) {
      topLeftMost=a;
    }
 else {
      topLeftMost=b;
    }
    wallDirection=Wall.VERTICAL;
    other=new SquareImpl(topLeftMost.getCol(),topLeftMost.getRow() - 1);
  }
 else {
    assert(Math.abs(a.getRow() - b.getRow()) == 1);
    if (a.getRow() < b.getRow()) {
      topLeftMost=a;
    }
 else {
      topLeftMost=b;
    }
    wallDirection=Wall.HORIZONTAL;
    other=new SquareImpl(topLeftMost.getCol() - 1,topLeftMost.getRow());
  }
  topLeftCandidate=new PairImpl<Square>(topLeftMost,other);
  candidateWalls=new PairImpl<Wall>(new WallImpl(topLeftCandidate._1(),wallDirection),new WallImpl(topLeftCandidate._2(),wallDirection));
  return walls.contains(candidateWalls._1()) || walls.contains(candidateWalls._2());
}
Program: 181095
Project: 181095
Buggy source:
/** 
 * Constructor for a SquareImpl from a row and column
 * @param row the row of the square
 * @param col the column of the square
 */
public SquareImpl(int row,int col){
  this.row=row;
  this.col=col;
}

Fixed version (ground truth):
/** 
 * Constructor for a SquareImpl from a row and column
 * @param row the row of the square
 * @param col the column of the square
 */
public SquareImpl(int col,int row){
  this.row=row;
  this.col=col;
}
Program: 181096
Project: 181096
Buggy source:
@Override public void play(){
  Player current=players._1();
  Pair<Pawn> pawns=new PairImpl<Pawn>(new PawnImpl(new SquareImpl(4,8),players._1()),new PawnImpl(new SquareImpl(4,0),players._2()));
  Board gameBoard=new BoardImpl(pawns);
  MoveParser parser=new MoveParserImpl();
  GenericMove nextMove;
  System.out.println(gameBoard.toString());
  while (!isOver()) {
    if (current.equals(players._1())) {
      System.out.println("String_Node_Str" + current.getName() + "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + current.getName() + "String_Node_Str");
    }
    nextMove=parser.scanMove(current,gameBoard);
    if (nextMove == null) {
      System.out.println("String_Node_Str");
    }
 else {
      moves.add(nextMove);
      if (nextMove.isValid()) {
        nextMove.makeMove();
        current=current.getOpponent();
        System.out.println(gameBoard.toString());
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
@Override public void play(){
  Player current=players._1();
  Pair<Pawn> pawns=new PairImpl<Pawn>(new PawnImpl(new SquareImpl(4,8),players._1()),new PawnImpl(new SquareImpl(4,0),players._2()));
  Board gameBoard=new BoardImpl(pawns);
  MoveParser parser=new MoveParserImpl();
  GenericMove nextMove;
  while (!isOver()) {
    System.out.println(gameBoard.toString());
    if (current == null) {
      System.out.println("String_Node_Str");
    }
    if (current.equals(players._1())) {
      System.out.println("String_Node_Str" + current.getName() + "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + current.getName() + "String_Node_Str");
    }
    nextMove=parser.scanMove(current,gameBoard);
    if (nextMove == null) {
      System.out.println("String_Node_Str");
    }
 else {
      moves.add(nextMove);
      if (nextMove.isValid()) {
        nextMove.makeMove();
        current=current.getOpponent();
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}
Program: 181097
Project: 181097
Buggy source:
/** 
 * Loops parsing input until the user invokes the exit command.
 * @param inputParser the input parser that parses users' input
 */
public static void inputLoop(Parser inputParser){
  boolean exit=false;
  short token;
  while (!exit) {
    System.out.print(PROMPT);
    token=inputParser.ensureCommand();
    if (token == EXIT) {
      exit=true;
    }
 else     if (token == NEW_GAME) {
      Pair<Player> players;
      if (inputParser.hasRequiredArgs()) {
        Player _1=new PlayerImpl(inputParser.nextArg());
        Player _2=new PlayerImpl(inputParser.nextArg());
        players=new PairImpl<Player>(_1,_2);
        _1.setOpponent(_2);
        _2.setOpponent(_2);
      }
 else {
        if (inputParser.hasErroneousArgs()) {
          System.out.println("String_Node_Str");
        }
        players=enterPlayers();
      }
      currentGame=new GameImpl(players);
      System.out.println("String_Node_Str".concat(players._1().getName()).concat("String_Node_Str").concat(players._2().getName()));
      currentGame.play();
    }
 else     if (token == HELP) {
      System.out.print(inputParser);
    }
 else     if (token == INVALID) {
      System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Loops parsing input until the user invokes the exit command.
 * @param inputParser the input parser that parses users' input
 */
public static void inputLoop(Parser inputParser){
  boolean exit=false;
  short token;
  while (!exit) {
    System.out.print(PROMPT);
    token=inputParser.ensureCommand();
    if (token == EXIT) {
      exit=true;
    }
 else     if (token == NEW_GAME) {
      Pair<Player> players;
      if (inputParser.hasRequiredArgs()) {
        Player _1=new PlayerImpl(inputParser.nextArg());
        Player _2=new PlayerImpl(inputParser.nextArg());
        players=new PairImpl<Player>(_1,_2);
        _1.setOpponent(_2);
        _2.setOpponent(_1);
      }
 else {
        if (inputParser.hasErroneousArgs()) {
          System.out.println("String_Node_Str");
        }
        players=enterPlayers();
      }
      currentGame=new GameImpl(players);
      System.out.println("String_Node_Str".concat(players._1().getName()).concat("String_Node_Str").concat(players._2().getName()));
      currentGame.play();
    }
 else     if (token == HELP) {
      System.out.print(inputParser);
    }
 else     if (token == INVALID) {
      System.out.println("String_Node_Str");
    }
  }
}
Program: 181098
Project: 181098
Buggy source:
/** 
 * Prompts the user to enter player names, then creates and returns a pair of players with those names.
 * @return A pair of players with names specified by the user
 */
public static Pair<Player> enterPlayers(){
  Player p1;
  Player p2;
  Scanner s=new Scanner(System.in);
  System.out.print("String_Node_Str");
  p1=new PlayerImpl(s.nextLine());
  System.out.print("String_Node_Str");
  p2=new PlayerImpl(s.nextLine());
  return new PairImpl<Player>(p1,p2);
}

Fixed version (ground truth):
/** 
 * Prompts the user to enter player names, then creates and returns a pair of players with those names.
 * @return A pair of players with names specified by the user
 */
public static Pair<Player> enterPlayers(){
  Player _1;
  Player _2;
  Scanner s=new Scanner(System.in);
  System.out.print("String_Node_Str");
  _1=new PlayerImpl(s.nextLine());
  System.out.print("String_Node_Str");
  _2=new PlayerImpl(s.nextLine());
  _1.setOpponent(_2);
  _2.setOpponent(_1);
  return new PairImpl<Player>(_1,_2);
}
Program: 181099
Project: 181099
Buggy source:
public GenericMove parseMove(String move,Player current,Board board){
  int len=move.length();
  boolean validInput=len == 2 || len == 3;
  int col=charNum(move.charAt(0));
  int row=-1;
  boolean type=GenericMove.PAWN;
  boolean dir=false;
  GenericMove result=null;
  ;
  if (validInput && row == -1) {
    validInput=false;
  }
 else   if (validInput) {
    row=parseInt(move.charAt(1)) - 1;
  }
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput && len == 3) {
    type=GenericMove.WALL;
    char dirChar=move.charAt(2);
    if (dirChar == 'h') {
      dir=Wall.HORIZONTAL;
    }
 else     if (dirChar == 'v') {
      dir=Wall.VERTICAL;
    }
 else {
      validInput=false;
    }
  }
  if (validInput) {
    if (type == GenericMove.PAWN) {
      result=new MovePawnImpl(col,row,current,board);
      System.out.println(len);
    }
 else     if (type == GenericMove.WALL) {
      result=new PlaceWallImpl(col,row,dir,current,board);
    }
  }
  return result;
}

Fixed version (ground truth):
public GenericMove parseMove(String move,Player current,Board board){
  int len=move.length();
  boolean validInput=len == 2 || len == 3;
  int col=-1;
  int row=-1;
  boolean type=GenericMove.PAWN;
  boolean dir=false;
  GenericMove result=null;
  ;
  col=charNum(move.charAt(0));
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput) {
    row=parseInt(move.charAt(1)) - 1;
  }
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput && len == 3) {
    type=GenericMove.WALL;
    char dirChar=move.charAt(2);
    if (dirChar == 'h') {
      dir=Wall.HORIZONTAL;
    }
 else     if (dirChar == 'v') {
      dir=Wall.VERTICAL;
    }
 else {
      validInput=false;
    }
  }
  if (validInput) {
    if (type == GenericMove.PAWN) {
      result=new MovePawnImpl(col,row,current,board);
      System.out.println(len);
    }
 else     if (type == GenericMove.WALL) {
      result=new PlaceWallImpl(col,row,dir,current,board);
    }
  }
  return result;
}
Program: 181101
Project: 181101
Buggy source:
@Override public void makeMove(){
  Pawn player=setting.getPawn(owner,setting);
  player.setSquare(destination);
  System.out.println("String_Node_Str" + setting);
}

Fixed version (ground truth):
@Override public void makeMove(){
  System.out.println("String_Node_Str" + setting);
  System.out.println("String_Node_Str" + owner.getName());
}
Program: 181102
Project: 181102
Buggy source:
@overide public String toString(){
  return null;
}

Fixed version (ground truth):
@Override public String toString(){
  return null;
}
Program: 181103
Project: 181103
Buggy source:
public boolean contains(X item){
  return null;
}

Fixed version (ground truth):
public boolean contains(X item){
  return false;
}
Program: 181104
Project: 181104
Buggy source:
/** 
 * Sorting                                                                     
 */
private void inPlaceSort(int beginIndex,int endIndex,PSTPoint s){
  Sort.heapSort(tree,baseZeroIndex(beginIndex),baseZeroIndex(endIndex));
}

Fixed version (ground truth):
/** 
 * Sorting                                                                     
 */
private void inPlaceSort(int beginIndex,int endIndex,PSTPoint s){
  Sort.insertionSort(tree,baseZeroIndex(beginIndex),baseZeroIndex(endIndex));
}
Program: 181106
Project: 181106
Buggy source:
private void buildLevel(int i){
  int n=tree.length;
  int h=(int)Math.floor(log2(n));
  int A=n - (powerOf2(h) - 1);
  int k=(int)Math.floor(A / powerOf2(h - i));
  PSTPoint s=getPoint(powerOf2(i + 1));
  int k1=powerOf2(h + 1 - i) - 1;
  int k2=powerOf2(h - i) - 1 + A - k * powerOf2(h - i);
  int k3=powerOf2(h - i) - 1;
  int indexOfMaxY;
  for (int j=1; j <= k; j++) {
    indexOfMaxY=powerOf2(i) + (j - 1) * k1;
    for (int index=indexOfMaxY; index <= powerOf2(i) + j * k1 - 1; index++)     if (getPoint(index).yGreaterThan(getPoint(indexOfMaxY)))     indexOfMaxY=index;
    swap(indexOfMaxY,powerOf2(i) + j - 1);
  }
  indexOfMaxY=powerOf2(i) + k * k1;
  for (int index=indexOfMaxY; index <= powerOf2(i) + k * k1 + k2 - 1; index++) {
    if (getPoint(index).yGreaterThan(getPoint(indexOfMaxY)))     indexOfMaxY=index;
  }
  swap(indexOfMaxY,powerOf2(i) + k);
  int m=powerOf2(i) + k * k1 + k2;
  for (int j=1; j <= powerOf2(i) - k - 1; j++) {
    indexOfMaxY=m + (j - 1) * k3;
    for (int index=indexOfMaxY; index <= m + j * k3 - 1; index++)     if (getPoint(index).yGreaterThan(getPoint(indexOfMaxY)))     indexOfMaxY=index;
    swap(indexOfMaxY,powerOf2(i) + k + j);
  }
  inPlaceSort(powerOf2(i + 1),n,s);
}

Fixed version (ground truth):
private void buildLevel(int i){
  int n=tree.length;
  int h=(int)Math.floor(log2(n));
  int A=n - (powerOf2(h) - 1);
  int k=(int)Math.floor(A / powerOf2(h - i));
  PSTPoint s=getPoint(powerOf2(i + 1));
  int k1=powerOf2(h + 1 - i) - 1;
  int k2=powerOf2(h - i) - 1 + A - k * powerOf2(h - i);
  int k3=powerOf2(h - i) - 1;
  int indexOfMaxY;
  for (int j=1; j <= k; j++) {
    indexOfMaxY=powerOf2(i) + (j - 1) * k1;
    for (int index=indexOfMaxY; index <= powerOf2(i) + j * k1 - 1; index++)     if (getPoint(index).yGreaterThan(getPoint(indexOfMaxY)))     indexOfMaxY=index;
    swap(indexOfMaxY,powerOf2(i) + j - 1);
  }
  if (k < powerOf2(i)) {
    indexOfMaxY=powerOf2(i) + k * k1;
    for (int index=indexOfMaxY; index <= powerOf2(i) + k * k1 + k2 - 1; index++) {
      if (getPoint(index).yGreaterThan(getPoint(indexOfMaxY)))       indexOfMaxY=index;
    }
    swap(indexOfMaxY,powerOf2(i) + k);
    int m=powerOf2(i) + k * k1 + k2;
    for (int j=1; j <= powerOf2(i) - k - 1; j++) {
      indexOfMaxY=m + (j - 1) * k3;
      for (int index=indexOfMaxY; index <= m + j * k3 - 1; index++)       if (getPoint(index).yGreaterThan(getPoint(indexOfMaxY)))       indexOfMaxY=index;
      swap(indexOfMaxY,powerOf2(i) + k + j);
    }
  }
  inPlaceSort(powerOf2(i + 1),n,s);
}
Program: 181107
Project: 181107
Buggy source:
public InPlacePST(PSTPoint[] points){
  tree=points;
  Sort.heapSort(tree,0,tree.length - 1);
  int h=(int)Math.floor(log2(tree.length));
  for (int i=0; i <= h - 1; i++)   buildLevel(i);
}

Fixed version (ground truth):
public InPlacePST(PSTPoint[] points){
  tree=points;
  Sort.insertionSort(tree,0,tree.length - 1);
  int h=(int)Math.floor(log2(tree.length));
  for (int i=0; i <= h - 1; i++)   buildLevel(i);
}
Program: 181112
Project: 181112
Buggy source:
public boolean onCommand(CommandSender sender,Command cmd,String commandLabel,String[] args){
  String name=((Player)sender).getDisplayName();
  User user=(userManager.userExists(name)) ? userManager.getUser((Player)sender) : null;
  if (user != null) {
    if (commandLabel.equalsIgnoreCase("String_Node_Str")) {
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.claimPlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.razePlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.resellPlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.setRegion(user,args[2]);
        }
      }
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          groupManager.foundNation(user,args[2]);
        }
      }
    }
    return true;
  }
  ((Player)sender).sendMessage("String_Node_Str");
  return false;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command cmd,String commandLabel,String[] args){
  String name=((Player)sender).getDisplayName();
  User user=(userManager.exists(name)) ? userManager.getUser((Player)sender) : null;
  if (user != null) {
    if (commandLabel.equalsIgnoreCase("String_Node_Str")) {
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.claimPlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.razePlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.resellPlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.setRegion(user,args[2]);
        }
      }
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          groupManager.foundNation(user,args[2]);
        }
      }
    }
    return true;
  }
  ((Player)sender).sendMessage("String_Node_Str");
  return false;
}
Program: 181113
Project: 181113
Buggy source:
@Override public void onBlockBreak(BlockBreakEvent event){
  Player player=event.getPlayer();
  Plot plot=plugin.plotManager.getPlotAtLocation(event.getBlock().getLocation());
  if (plot != null && !plot.getOwner().equals(player.getDisplayName())) {
    event.setCancelled(true);
    plugin.sendToLog("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onBlockBreak(BlockBreakEvent event){
  User user=plugin.userManager.getUser(event.getPlayer());
  Plot plot=plugin.plotManager.getPlotAtLocation(event.getBlock().getLocation());
  if (plot != null && !plot.getOwner().equals(user.getNation())) {
    event.setCancelled(true);
    plugin.sendToLog("String_Node_Str");
  }
}
Program: 181114
Project: 181114
Buggy source:
@Override public void onBlockDamage(BlockDamageEvent event){
  Player player=event.getPlayer();
  Plot plot=plugin.plotManager.getPlotAtLocation(event.getBlock().getLocation());
  if (plot != null && !plot.getOwner().equals(player.getDisplayName())) {
    event.setCancelled(true);
    plugin.sendToLog("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onBlockDamage(BlockDamageEvent event){
  User user=plugin.userManager.getUser(event.getPlayer());
  Plot plot=plugin.plotManager.getPlotAtLocation(event.getBlock().getLocation());
  if (plot != null && !plot.getOwner().equals(user.getNation())) {
    event.setCancelled(true);
    plugin.sendToLog("String_Node_Str");
  }
}
Program: 181115
Project: 181115
Buggy source:
@Override public void onBlockPlace(BlockPlaceEvent event){
  Player player=event.getPlayer();
  Plot plot=plugin.plotManager.getPlotAtLocation(event.getBlock().getLocation());
  if (plot != null && !plot.getOwner().equals(player.getDisplayName())) {
    event.setCancelled(true);
    plugin.sendToLog("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onBlockPlace(BlockPlaceEvent event){
  User user=plugin.userManager.getUser(event.getPlayer());
  Plot plot=plugin.plotManager.getPlotAtLocation(event.getBlock().getLocation());
  if (plot != null && !plot.getOwner().equals(user.getNation())) {
    event.setCancelled(true);
    plugin.sendToLog("String_Node_Str");
  }
}
Program: 181116
Project: 181116
Buggy source:
@Override public void onPlayerKick(PlayerKickEvent event){
  String name=event.getPlayer().getDisplayName();
  plugin.userManager.saveObject(name);
  plugin.userManager.collection.remove(name);
}

Fixed version (ground truth):
@Override public void onPlayerKick(PlayerKickEvent event){
  String name=event.getPlayer().getDisplayName();
  plugin.userManager.saveObject(name);
}
Program: 181117
Project: 181117
Buggy source:
@Override public void onPlayerQuit(PlayerQuitEvent event){
  String name=event.getPlayer().getDisplayName();
  plugin.userManager.saveObject(name);
  plugin.userManager.collection.remove(name);
}

Fixed version (ground truth):
@Override public void onPlayerQuit(PlayerQuitEvent event){
  String name=event.getPlayer().getDisplayName();
  plugin.userManager.saveObject(name);
}
Program: 181118
Project: 181118
Buggy source:
@Override public void onPlayerMove(PlayerMoveEvent event){
  plugin.userManager.updateLocation(event.getPlayer());
}

Fixed version (ground truth):
@Override public void onPlayerMove(PlayerMoveEvent event){
  Player player=event.getPlayer();
  if (plugin.userManager.exists(player.getDisplayName())) {
    User user=plugin.userManager.getUser(player);
    plugin.userManager.updateLocation(user);
  }
}
Program: 181119
Project: 181119
Buggy source:
@Override public void onPlayerJoin(PlayerJoinEvent event){
  Player player=event.getPlayer();
  String name=player.getDisplayName();
  if (plugin.userManager.userExists(name)) {
    plugin.userManager.setupUser(player);
  }
 else {
    if (REGISTER_ON_JOIN) {
      plugin.userManager.registerUser(player);
      plugin.userManager.setupUser(player);
    }
 else {
      player.sendMessage("String_Node_Str");
      player.sendMessage("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerJoin(PlayerJoinEvent event){
  Player player=event.getPlayer();
  String name=player.getDisplayName();
  if (plugin.userManager.exists(name)) {
    plugin.userManager.setupUser(player);
  }
 else {
    if (REGISTER_ON_JOIN) {
      plugin.userManager.registerUser(player);
      plugin.userManager.setupUser(player);
    }
 else {
      player.sendMessage("String_Node_Str");
      player.sendMessage("String_Node_Str");
    }
  }
}
Program: 181120
Project: 181120
Buggy source:
/** 
 * Fetches the Group for the provided group name, if it exists.
 * @param key The group name of the Group to get
 * @return the Group with a matching name
 */
public Group getGroup(String key){
  return (groupExists(key)) ? (Group)collection.get(key) : null;
}

Fixed version (ground truth):
/** 
 * Fetches the Group for the provided group name, if it exists.
 * @param key The group name of the Group to get
 * @return the Group with a matching name
 */
public Group getGroup(String key){
  return (exists(key)) ? (Group)collection.get(key) : null;
}
Program: 181121
Project: 181121
Buggy source:
/** 
 * Creates a nation Group for the commanding User and sets them in a position of leadership for that Group.
 * @param user The User creating the nation Group
 * @param name The name of the new nation Group
 */
public void foundNation(User user,String name){
  if (!groupExists(name)) {
    if (user.getNation().equals("String_Node_Str")) {
      Group group=new Group(name);
      group.addMember(user.getKey());
      group.addLeader(user.getKey());
      user.setNation(name);
      collection.put(name,group);
      saveObject(name);
      user.message("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      user.message("String_Node_Str");
    }
  }
 else {
    user.message("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Creates a nation Group for the commanding User and sets them in a position of leadership for that Group.
 * @param user The User creating the nation Group
 * @param name The name of the new nation Group
 */
public void foundNation(User user,String name){
  if (!exists(name)) {
    if (user.getNation().equals("String_Node_Str")) {
      Group group=new Group(name);
      group.addMember(user.getName());
      group.addLeader(user.getName());
      user.setNation(name);
      collection.put(name,group);
      saveObject(name);
      user.message("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      user.message("String_Node_Str");
    }
  }
 else {
    user.message("String_Node_Str");
  }
}
Program: 181122
Project: 181122
Buggy source:
/** 
 * Flags a Plot as being available for resale by the commanding User/Nation.
 * @param user The User reselling the Plot
 * @return true if the Plot resale status was toggled, falseotherwise
 */
public Boolean resellPlot(User user){
  String locKey=user.getLocationKey();
  Plot plot=getPlotAtUser(user);
  if (!plotExists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user) && plot.getOwner().equals(user.getNation())) {
    plot.setSaleStatus(!plot.getSaleStatus());
    showBoundaries(plot);
    if (plot.getSaleStatus()) {
      user.message("String_Node_Str" + locKey + "String_Node_Str");
    }
 else {
      user.message("String_Node_Str" + locKey + "String_Node_Str");
    }
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Flags a Plot as being available for resale by the commanding User/Nation.
 * @param user The User reselling the Plot
 * @return true if the Plot resale status was toggled, falseotherwise
 */
public Boolean resellPlot(User user){
  String locKey=user.getLocationKey();
  Plot plot=getPlotAtUser(user);
  if (!exists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user) && plot.getOwner().equals(user.getNation())) {
    plot.setSaleStatus(!plot.getSaleStatus());
    showBoundaries(plot);
    if (plot.getSaleStatus()) {
      user.message("String_Node_Str" + locKey + "String_Node_Str");
    }
 else {
      user.message("String_Node_Str" + locKey + "String_Node_Str");
    }
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}
Program: 181123
Project: 181123
Buggy source:
/** 
 * Renames the regional description of the Plot for the commanding User/Nation.
 * @param user The user renaming the Plot's region
 * @param region The new region description
 * @return true if the Plot's region was renamed, false otherwise
 */
public Boolean setRegion(User user,String region){
  String locKey=user.getLocationKey();
  Plot plot=getPlotAtUser(user);
  if (!plotExists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user) && plot.getOwner() == user.getNation()) {
    plot.setRegion(region);
    saveObject(locKey);
    user.setCurrentLocationName(plot.getLoctionName());
    user.message("String_Node_Str" + locKey + "String_Node_Str"+ region);
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Renames the regional description of the Plot for the commanding User/Nation.
 * @param user The user renaming the Plot's region
 * @param region The new region description
 * @return true if the Plot's region was renamed, false otherwise
 */
public Boolean setRegion(User user,String region){
  String locKey=user.getLocationKey();
  Plot plot=getPlotAtUser(user);
  if (!exists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user) && plot.getOwner().equals(user.getNation())) {
    plot.setRegion(region);
    saveObject(locKey);
    user.setCurrentLocationDescription(plot.getLoctionDescription());
    user.message("String_Node_Str" + locKey + "String_Node_Str"+ region);
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}
Program: 181124
Project: 181124
Buggy source:
/** 
 * Fetches the Plot for the provided location key, if it exists.
 * @param key The location key of the Plot to get
 * @return the Plot at the provided location key, null if no matching instance exists
 */
public Plot getPlot(String key){
  return (plotExists(key)) ? (Plot)collection.get(key) : null;
}

Fixed version (ground truth):
/** 
 * Fetches the Plot for the provided location key, if it exists.
 * @param key The location key of the Plot to get
 * @return the Plot at the provided location key, null if no matching instance exists
 */
public Plot getPlot(String key){
  return (exists(key)) ? (Plot)collection.get(key) : null;
}
Program: 181125
Project: 181125
Buggy source:
/** 
 * Creates a Plot (if none exists), gives ownership to the  commanding User/Nation, then loads the Plot into 'collection' and saves it to the data source.
 * @param user The User claiming the Plot
 * @return true if the Plot was created, false otherwise
 */
public Boolean claimPlot(User user){
  String locKey=user.getLocationKey();
  if (plotExists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user)) {
    Location loc=user.getLocation();
    Plot plot=new Plot(plugin.getWorld(),(int)loc.getX(),(int)loc.getZ());
    plot.setOwner(user.getNation());
    collection.put(locKey,plot);
    saveObject(locKey);
    plugin.groupManager.getGroup(user.getNation()).addPlot(locKey);
    showBoundaries(plot);
    user.message("String_Node_Str" + locKey + "String_Node_Str");
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Creates a Plot (if none exists), gives ownership to the  commanding User/Nation, then loads the Plot into 'collection' and saves it to the data source.
 * @param user The User claiming the Plot
 * @return true if the Plot was created, false otherwise
 */
public Boolean claimPlot(User user){
  String locKey=user.getLocationKey();
  if (exists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user)) {
    Location loc=user.getLocation();
    Plot plot=new Plot(plugin.getWorld(),(int)loc.getX(),(int)loc.getZ());
    plot.setOwner(user.getNation());
    collection.put(locKey,plot);
    user.setCurrentLocationDescription(plot.getLoctionDescription());
    saveObject(locKey);
    plugin.groupManager.getGroup(user.getNation()).addPlot(locKey);
    showBoundaries(plot);
    user.message("String_Node_Str" + locKey + "String_Node_Str");
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}
Program: 181126
Project: 181126
Buggy source:
/** 
 * Fetches the Plot from a User's location
 * @param user The User at the Plot
 * @return the Plot at the User's location, nullif no Plot was found
 */
public Plot getPlotAtUser(User user){
  Plot plot=getPlot(user.getLocationKey());
  if (plot == null) {
    plugin.sendToLog("String_Node_Str" + user.getKey() + "String_Node_Str");
  }
  return plot;
}

Fixed version (ground truth):
/** 
 * Fetches the Plot from a User's location
 * @param user The User at the Plot
 * @return the Plot at the User's location, nullif no Plot was found
 */
public Plot getPlotAtUser(User user){
  Plot plot=getPlot(user.getLocationKey());
  if (plot == null) {
    plugin.sendToLog("String_Node_Str" + user.getName() + "String_Node_Str");
  }
  return plot;
}
Program: 181127
Project: 181127
Buggy source:
/** 
 * Destroys the Plot and ownership settings for the commanding  User/Nation.
 * @param user The User destroying the Plot
 * @return true if the Plot was destroyed, false otherwise
 */
public Boolean razePlot(User user){
  String locKey=user.getLocationKey();
  Plot plot=getPlotAtUser(user);
  if (!plotExists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user) && plot.getOwner().equals(user.getNation())) {
    collection.remove(locKey);
    deleteObject(locKey);
    plugin.groupManager.getGroup(user.getNation()).removePlot(locKey);
    user.setCurrentLocationName("String_Node_Str");
    user.message("String_Node_Str" + locKey + "String_Node_Str");
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Destroys the Plot and ownership settings for the commanding  User/Nation.
 * @param user The User destroying the Plot
 * @return true if the Plot was destroyed, false otherwise
 */
public Boolean razePlot(User user){
  String locKey=user.getLocationKey();
  Plot plot=getPlotAtUser(user);
  if (!exists(locKey)) {
    user.message("String_Node_Str");
    return false;
  }
  if (plugin.userManager.isLeader(user) && plot.getOwner().equals(user.getNation())) {
    collection.remove(locKey);
    deleteObject(locKey);
    plugin.groupManager.getGroup(user.getNation()).removePlot(locKey);
    user.setCurrentLocationDescription("String_Node_Str");
    user.message("String_Node_Str" + locKey + "String_Node_Str");
    return true;
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}
Program: 181128
Project: 181128
Buggy source:
private void check(){
  File file=new File("String_Node_Str");
  try {
    if (!file.exists()) {
      file.createNewFile();
      BufferedWriter out=new BufferedWriter(new FileWriter(file));
      for (      Object key : properties.keySet()) {
        out.write(key + "String_Node_Str" + properties.getProperty((String)key));
        out.newLine();
      }
      out.close();
    }
 else {
      properties.load(new FileInputStream(file));
      plugin.sendToLog("String_Node_Str");
    }
  }
 catch (  IOException e) {
    plugin.sendToLog(e.getMessage());
  }
}

Fixed version (ground truth):
private void check(){
  File folder=new File("String_Node_Str");
  File file=new File("String_Node_Str");
  try {
    if (!folder.exists()) {
      folder.mkdirs();
    }
    if (!file.exists()) {
      file.createNewFile();
      BufferedWriter out=new BufferedWriter(new FileWriter(file));
      for (      Object key : properties.keySet()) {
        out.write(key + "String_Node_Str" + properties.getProperty((String)key));
        out.newLine();
      }
      out.close();
      plugin.sendToLog("String_Node_Str");
    }
 else {
      properties.load(new FileInputStream(file));
      plugin.sendToLog("String_Node_Str");
    }
  }
 catch (  IOException e) {
    plugin.sendToLog(e.getMessage());
  }
}
Program: 181130
Project: 181130
Buggy source:
/** 
 * Creates a nation Group for the commanding User and sets them in a position of leadership for that Group.
 * @param user The User creating the nation Group
 * @param name The name of the new nation Group
 */
public void foundNation(User user,String name){
  if (!exists(name)) {
    if (user.getNation().equals("String_Node_Str")) {
      Group group=new Group(name);
      group.addMember(user.getName());
      group.addLeader(user.getName());
      user.setNation(name);
      collection.put(name,group);
      saveObject(name);
      plugin.messageAll("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      user.message("String_Node_Str");
    }
  }
 else {
    user.message("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Creates a nation Group for the commanding User and sets them in a position of leadership for that Group.
 * @param user The User creating the nation Group
 * @param name The name of the new nation Group
 * @return true if the nation was founded, false otherwise
 */
public Boolean foundNation(User user,String name){
  if (!exists(name)) {
    if (user.getNation().equals("String_Node_Str")) {
      Group group=new Group(name);
      group.addMember(user.getName());
      group.addLeader(user.getName());
      user.setNation(name);
      collection.put(name,group);
      saveObject(name);
      plugin.messageAll("String_Node_Str" + name + "String_Node_Str");
      return true;
    }
 else {
      user.message("String_Node_Str");
      return false;
    }
  }
 else {
    user.message("String_Node_Str");
    return false;
  }
}
Program: 181131
Project: 181131
Buggy source:
public Group(String n){
  name=n;
  members=new ArrayList<String>();
  leaders=new ArrayList<String>();
  plots=new ArrayList<String>();
  allies=new ArrayList<String>();
  enemies=new ArrayList<String>();
}

Fixed version (ground truth):
public Group(String n){
  name=n;
  tax=0;
  members=new ArrayList<String>();
  leaders=new ArrayList<String>();
  plots=new ArrayList<String>();
  allies=new ArrayList<String>();
  enemies=new ArrayList<String>();
}
Program: 181132
Project: 181132
Buggy source:
public boolean onCommand(CommandSender sender,Command cmd,String commandLabel,String[] args){
  if (userManager.collection.containsKey(((Player)sender).getDisplayName())) {
    if (commandLabel.equalsIgnoreCase("String_Node_Str")) {
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.claimPlot((Player)sender);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.razePlot((Player)sender);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.resellPlot((Player)sender);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.setRegion((Player)sender,args[2]);
        }
      }
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          groupManager.foundNation((Player)sender,args[2]);
        }
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command cmd,String commandLabel,String[] args){
  String name=((Player)sender).getDisplayName();
  User user=(userManager.userExists(name)) ? userManager.getUser((Player)sender) : null;
  if (user != null) {
    if (commandLabel.equalsIgnoreCase("String_Node_Str")) {
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.claimPlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.razePlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.resellPlot(user);
        }
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          plotManager.setRegion(user,args[2]);
        }
      }
      if (args[0].equalsIgnoreCase("String_Node_Str")) {
        if (args[1].equalsIgnoreCase("String_Node_Str")) {
          groupManager.foundNation(user,args[2]);
        }
      }
    }
    return true;
  }
  ((Player)sender).sendMessage("String_Node_Str");
  return false;
}
Program: 181133
Project: 181133
Buggy source:
public void onEnable(){
  setupPermissions();
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.BLOCK_DAMAGE,blockListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.BLOCK_BREAK,blockListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.BLOCK_PLACE,blockListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_JOIN,userListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_QUIT,userListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_KICK,userListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_MOVE,userListener,Event.Priority.High,this);
  plotManager.loadAll();
  groupManager.loadAll();
  this.sendToLog("String_Node_Str");
}

Fixed version (ground truth):
public void onEnable(){
  setupPermissions();
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.BLOCK_DAMAGE,blockListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.BLOCK_BREAK,blockListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.BLOCK_PLACE,blockListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_JOIN,userListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_QUIT,userListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_KICK,userListener,Event.Priority.Normal,this);
  pm.registerEvent(Event.Type.PLAYER_MOVE,userListener,Event.Priority.High,this);
  plotManager.loadAll();
  groupManager.loadAll();
  userManager.loadAll();
  sendToLog("String_Node_Str");
}
Program: 181134
Project: 181134
Buggy source:
/** 
 * Deserializes and sends data to the server.
 * @param type The type of data being loaded. Determines theload path.
 * @param key The identification key of the data being loaded.Determines the file name.
 * @return the deserialized object
 */
@Override public NAWObject load(String type,String key){
  File file=new File(paths.get(type) + key);
  NAWObject obj=null;
  try {
    ObjectInputStream in=new ObjectInputStream(new FileInputStream(file));
    obj=(NAWObject)in.readObject();
    in.close();
    plugin.sendToLog(key + "String_Node_Str");
    return obj;
  }
 catch (  IOException e) {
    plugin.sendToLog(e.getMessage());
    return null;
  }
catch (  ClassNotFoundException e) {
    plugin.sendToLog(e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Deserializes and sends data to the server.
 * @param type The type of data being loaded. Determines theload path.
 * @param key The identification key of the data being loaded.Determines the file name.
 * @return the deserialized object
 */
@Override public NAWObject load(String type,String key){
  File file=new File(paths.get(type) + key);
  NAWObject obj=null;
  try {
    ObjectInputStream in=new ObjectInputStream(new FileInputStream(file));
    obj=(NAWObject)in.readObject();
    in.close();
    return obj;
  }
 catch (  IOException e) {
    plugin.sendToLog(e.getMessage());
  }
catch (  ClassNotFoundException e) {
    plugin.sendToLog(e.getMessage());
  }
  return null;
}
Program: 181135
Project: 181135
Buggy source:
/** 
 * Serializes and stores the data to a file.
 * @param type The type of data being saved. Determines thesave path.
 * @param key The identification key of the data being saved. Determines the file name.
 * @param obj The data to save
 */
public void save(String type,String key,NAWObject obj){
  File file=new File(paths.get(type) + key);
  try {
    if (!file.exists()) {
      file.createNewFile();
    }
    ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream(file));
    out.writeObject(obj);
    out.close();
    plugin.sendToLog(key + "String_Node_Str");
  }
 catch (  IOException e) {
    plugin.sendToLog(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Serializes and stores the data to a file.
 * @param type The type of data being saved. Determines thesave path.
 * @param key The identification key of the data being saved. Determines the file name.
 * @param obj The data to save
 */
public void save(String type,String key,NAWObject obj){
  File file=new File(paths.get(type) + key);
  try {
    if (!file.exists()) {
      file.createNewFile();
    }
    ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream(file));
    out.writeObject(obj);
    out.close();
  }
 catch (  IOException e) {
    plugin.sendToLog(e.getMessage());
  }
}
Program: 181136
Project: 181136
Buggy source:
@Override public void onPlayerJoin(PlayerJoinEvent event){
  Player player=event.getPlayer();
  player.sendMessage("String_Node_Str");
  if (plugin.userManager.loadUser(player)) {
    plugin.userManager.updateLocation(player);
  }
 else {
    if (registerOnJoin) {
      plugin.userManager.registerUser(player);
    }
 else {
      player.sendMessage("String_Node_Str");
      player.sendMessage("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerJoin(PlayerJoinEvent event){
  Player player=event.getPlayer();
  String name=player.getDisplayName();
  if (plugin.userManager.userExists(name)) {
    plugin.userManager.loadUser(player);
  }
 else {
    if (REGISTER_ON_JOIN) {
      plugin.userManager.registerUser(player);
      plugin.userManager.loadUser(player);
    }
 else {
      player.sendMessage("String_Node_Str");
      player.sendMessage("String_Node_Str");
    }
  }
}
Program: 181137
Project: 181137
Buggy source:
public void foundNation(Player player,String name){
  if (!collection.containsKey(name)) {
    Group group=new Group(name);
    group.addMember(player.getDisplayName());
    group.setFounder(player.getDisplayName());
    collection.put(name,group);
    this.saveObject(name);
    player.sendMessage("String_Node_Str" + name + "String_Node_Str");
  }
 else {
    player.sendMessage("String_Node_Str");
  }
}

Fixed version (ground truth):
public void foundNation(User user,String name){
  if (!groupExists(name)) {
    if (user.getNation().equals("String_Node_Str")) {
      Group group=new Group(name);
      group.addMember(user.getKey());
      group.addLeader(user.getKey());
      user.setNation(name);
      collection.put(name,group);
      saveObject(name);
      user.message("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      user.message("String_Node_Str");
    }
  }
 else {
    user.message("String_Node_Str");
  }
}
Program: 181138
Project: 181138
Buggy source:
/** 
 * Stores all objects on the server to the data source
 */
public void saveAll(){
  for (  String key : collection.keySet()) {
    saveObject(key.toString());
  }
}

Fixed version (ground truth):
/** 
 * Stores all objects on the server to the data source
 */
public void saveAll(){
  for (  String key : collection.keySet()) {
    saveObject(key.toString());
  }
  plugin.sendToLog(String.valueOf(collection.size()) + "String_Node_Str" + type+ "String_Node_Str");
}
Program: 181139
Project: 181139
Buggy source:
/** 
 * Loads all objects from the data source to the server
 */
public void loadAll(){
  ArrayList<String> keys=database.gatherDataset(type);
  for (  String key : keys) {
    loadObject(key);
  }
}

Fixed version (ground truth):
/** 
 * Loads all objects from the data source to the server
 */
public void loadAll(){
  ArrayList<String> keys=database.gatherDataset(type);
  for (  String key : keys) {
    loadObject(key);
  }
  plugin.sendToLog(String.valueOf(collection.size()) + "String_Node_Str" + type+ "String_Node_Str");
}
Program: 181140
Project: 181140
Buggy source:
public static void main(String[] args){
  List<List<Double>> tuple1=simulate(new EconCost());
  List<List<Double>> tuple2=simulate(new ShortestPathCost());
  for (int i=0; i < tuple1.get(0).size(); i++) {
    System.out.println(tuple1.get(0).get(i) + "String_Node_Str" + tuple2.get(0).get(i));
  }
  for (int i=0; i < tuple1.get(1).size(); i++) {
    System.err.println(tuple1.get(1).get(i) + "String_Node_Str" + tuple2.get(1).get(i));
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  List<List<Double>> tuple1=simulate(new EconCost());
  List<List<Double>> tuple2=simulate(new ShortestPathCost());
  BufferedWriter costOutput=new BufferedWriter(new FileWriter(new File("String_Node_Str")));
  BufferedWriter milesOutput=new BufferedWriter(new FileWriter(new File("String_Node_Str")));
  for (int i=0; i < tuple1.get(0).size(); i++) {
    costOutput.write(tuple1.get(0).get(i) + "String_Node_Str" + tuple2.get(0).get(i));
    costOutput.newLine();
  }
  for (int i=0; i < tuple1.get(1).size(); i++) {
    milesOutput.write(tuple1.get(1).get(i) + "String_Node_Str" + tuple2.get(1).get(i));
    milesOutput.newLine();
  }
  costOutput.close();
  milesOutput.close();
}
Program: 181141
Project: 181141
Buggy source:
private static List<List<Double>> simulate(Comparator<Route> routeMetric){
  List<List<Double>> tuple=new ArrayList<List<Double>>();
  tuple.add(new ArrayList<Double>());
  tuple.add(new ArrayList<Double>());
  Internet myInternet=new Internet(routeMetric);
  boolean stop=false;
  while (!stop) {
    stop=true;
    for (    POP pop : myInternet.getAllPOPs()) {
      stop=pop.propogate() && stop;
    }
  }
  for (  POP pop : myInternet.getAllPOPs()) {
    List<Route> routes=pop.getRoutes();
    for (    Route r : routes) {
      tuple.get(0).add(r.getCost());
      tuple.get(1).add(r.getMiles());
    }
  }
  return tuple;
}

Fixed version (ground truth):
private static List<List<Double>> simulate(Comparator<Route> routeMetric){
  List<List<Double>> tuple=new ArrayList<List<Double>>();
  tuple.add(new ArrayList<Double>());
  tuple.add(new ArrayList<Double>());
  Internet myInternet=new Internet(routeMetric);
  int iterations=0;
  for (; ; ) {
    iterations++;
    boolean someoneChanged=false;
    for (    POP pop : myInternet.getAllPOPs()) {
      boolean changed=pop.propogate();
      if (changed)       someoneChanged=true;
    }
    if (!someoneChanged)     break;
  }
  System.err.println("String_Node_Str" + iterations);
  for (  POP pop : myInternet.getAllPOPs()) {
    List<Route> routes=pop.getRoutes();
    for (    Route r : routes) {
      tuple.get(0).add(r.getCost());
      tuple.get(1).add(r.getMiles());
    }
  }
  return tuple;
}