nus-yam/ex-repair huggingface dataset:
Program: 173616
Project: 173616
Buggy source:
protected boolean checkNormalTileLay(TileI tile,boolean update){
  String colour=tile.getColourName();
  Integer oldAllowedNumberObject=tileLaysPerColour.get(colour);
  if (oldAllowedNumberObject == null)   return false;
  int oldAllowedNumber=oldAllowedNumberObject.intValue();
  if (oldAllowedNumber <= 0)   return false;
  if (!update)   return true;
  if (oldAllowedNumber <= 1) {
    for (    String key : tileLaysPerColour.viewKeySet()) {
      tileLaysPerColour.put(key,new Integer(0));
    }
    log.debug("String_Node_Str");
    currentNormalTileLays.clear();
  }
 else {
    for (    String key : tileLaysPerColour.viewKeySet()) {
      if (colour.equals(key)) {
        tileLaysPerColour.put(colour,new Integer(oldAllowedNumber - 1));
      }
 else {
        tileLaysPerColour.put(key,new Integer(0));
      }
    }
    log.debug((oldAllowedNumber - 1) + "String_Node_Str" + colour+ "String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkNormalTileLay(TileI tile,boolean update){
  String colour=tile.getColourName();
  Integer oldAllowedNumberObject=tileLaysPerColour.get(colour);
  if (oldAllowedNumberObject == null)   return false;
  int oldAllowedNumber=oldAllowedNumberObject.intValue();
  if (oldAllowedNumber <= 0)   return false;
  if (update)   updateAllowedTileColours(colour,oldAllowedNumber);
  return true;
}
Program: 173617
Project: 173617
Buggy source:
public void setTileColours(Map<String,Integer> map){
  tileColours=new HashMap<String,Integer>();
  for (  String colourName : map.keySet()) {
    if (map.get(colourName) > 0)     tileColours.put(colourName,map.get(colourName));
  }
}

Fixed version (ground truth):
public void setTileColours(Map<String,Integer> map){
  tileColours=new HashMap<String,Integer>();
  if (map != null) {
    for (    String colourName : map.keySet()) {
      if (map.get(colourName) > 0)       tileColours.put(colourName,map.get(colourName));
    }
  }
}
Program: 173618
Project: 173618
Buggy source:
@Override public boolean undo(){
  if (keyExisted) {
    map.put(key,oldValue);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean undo(){
  if (keyExisted) {
    map.put(key,oldValue);
  }
 else {
    map.remove(key);
  }
  return true;
}
Program: 173619
Project: 173619
Buggy source:
public String toString(){
  return "String_Node_Str" + key + "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + key + "String_Node_Str"+ oldValue+ "String_Node_Str";
}
Program: 173620
Project: 173620
Buggy source:
/** 
 * Creates a move that removes key from map
 */
public RemoveFromMap(Map<K,V> map,K key){
  this.map=map;
  this.key=key;
  this.keyExisted=map.containsKey(key);
  MoveSet.add(this);
}

Fixed version (ground truth):
/** 
 * Creates a move that removes key from map
 */
public RemoveFromMap(Map<K,V> map,K key){
  keyExisted=map.containsKey(key);
  if (!keyExisted)   return;
  this.map=map;
  this.key=key;
  this.oldValue=map.get(key);
  MoveSet.add(this);
}
Program: 173621
Project: 173621
Buggy source:
public void clear(){
  for (  K key : map.keySet()) {
    remove(key);
  }
}

Fixed version (ground truth):
public void clear(){
  List<K> keys=new ArrayList<K>();
  for (  K key : map.keySet()) {
    keys.add(key);
  }
  for (  K key : keys) {
    remove(key);
  }
}
Program: 173622
Project: 173622
Buggy source:
public void finishConfiguration(GameManagerI gameManager) throws ConfigurationException {
  this.gameManager=gameManager;
  bank=gameManager.getBank();
  ipo=bank.getIpo();
  unavailable=bank.getUnavailable();
  for (  TrainTypeI type : lTrainTypes) {
    type.finishConfiguration(gameManager);
  }
  newTypeIndex.set(0);
  lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank);
  if (removeTrain) {
    gameManager.setGameParameter(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR,true);
  }
}

Fixed version (ground truth):
public void finishConfiguration(GameManagerI gameManager) throws ConfigurationException {
  this.gameManager=gameManager;
  bank=gameManager.getBank();
  ipo=bank.getIpo();
  unavailable=bank.getUnavailable();
  for (  TrainTypeI type : lTrainTypes) {
    type.finishConfiguration(gameManager);
  }
  newTypeIndex.set(0);
  lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank);
  if (removeTrain) {
    gameManager.setGameParameter(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR,true);
  }
  gameManager.setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS,trainPriceAtFaceValueIfDifferentPresidents);
}
Program: 173624
Project: 173624
Buggy source:
public List<PublicCompanyI> setOperatingCompanies(List<PublicCompanyI> oldOperatingCompanies,PublicCompanyI lastOperatingCompany){
  Map<Integer,PublicCompanyI> operatingCompanies=new TreeMap<Integer,PublicCompanyI>();
  StockSpaceI space;
  int key;
  int minorNo=0;
  boolean reorder=gameManager.isDynamicOperatingOrder() && oldOperatingCompanies != null && lastOperatingCompany != null;
  int lastOperatingCompanyIndex;
  if (reorder) {
    lastOperatingCompanyIndex=oldOperatingCompanies.indexOf(lastOperatingCompany);
  }
 else {
    lastOperatingCompanyIndex=-1;
  }
  for (  PublicCompanyI company : companyManager.getAllPublicCompanies()) {
    if (!canCompanyOperateThisRound(company))     continue;
    if (reorder && oldOperatingCompanies.indexOf(company) <= lastOperatingCompanyIndex) {
      key=oldOperatingCompanies.indexOf(company);
    }
 else     if (company.hasStockPrice()) {
      space=company.getCurrentSpace();
      key=1000000 * (999 - space.getPrice()) + 10000 * (99 - space.getColumn()) + 100 * (space.getRow() + 1) + space.getStackPosition(company);
    }
 else {
      key=50 + ++minorNo;
    }
    operatingCompanies.put(new Integer(key),company);
  }
  return new ArrayList<PublicCompanyI>(operatingCompanies.values());
}

Fixed version (ground truth):
public List<PublicCompanyI> setOperatingCompanies(List<PublicCompanyI> oldOperatingCompanies,PublicCompanyI lastOperatingCompany){
  Map<Integer,PublicCompanyI> operatingCompanies=new TreeMap<Integer,PublicCompanyI>();
  List<PublicCompanyI> newOperatingCompanies;
  StockSpaceI space;
  int key;
  int minorNo=0;
  boolean reorder=gameManager.isDynamicOperatingOrder() && oldOperatingCompanies != null && lastOperatingCompany != null;
  int lastOperatingCompanyIndex;
  if (reorder) {
    newOperatingCompanies=oldOperatingCompanies;
    lastOperatingCompanyIndex=oldOperatingCompanies.indexOf(lastOperatingCompany);
  }
 else {
    newOperatingCompanies=companyManager.getAllPublicCompanies();
    lastOperatingCompanyIndex=-1;
  }
  for (  PublicCompanyI company : newOperatingCompanies) {
    if (!reorder && !canCompanyOperateThisRound(company))     continue;
    if (reorder && oldOperatingCompanies.indexOf(company) <= lastOperatingCompanyIndex) {
      key=oldOperatingCompanies.indexOf(company);
    }
 else     if (company.hasStockPrice()) {
      space=company.getCurrentSpace();
      key=1000000 * (999 - space.getPrice()) + 10000 * (99 - space.getColumn()) + 100 * (space.getRow() + 1) + space.getStackPosition(company);
    }
 else {
      key=50 + ++minorNo;
    }
    operatingCompanies.put(new Integer(key),company);
  }
  return new ArrayList<PublicCompanyI>(operatingCompanies.values());
}
Program: 173626
Project: 173626
Buggy source:
public void endOfGameReport(){
  GameManagerI gm=GameManager.getInstance();
  if (gm.getGameOverReportedUI())   return;
 else   gm.setGameOverReportedUI(true);
  JOptionPane.showMessageDialog(this,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
  List<String> gameReport=GameManager.getInstance().getGameReport();
  Collections.reverse(gameReport);
  StringBuilder report=new StringBuilder();
  for (  String s : gameReport) {
    report.insert(0,s + "String_Node_Str");
    JOptionPane.showMessageDialog(this,report,LocalText.getText("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
  }
}

Fixed version (ground truth):
public void endOfGameReport(){
  GameManagerI gm=gameUIManager.getGameManager();
  if (gm.getGameOverReportedUI())   return;
 else   gm.setGameOverReportedUI(true);
  JOptionPane.showMessageDialog(this,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
  List<String> gameReport=gm.getGameReport();
  Collections.reverse(gameReport);
  StringBuilder report=new StringBuilder();
  for (  String s : gameReport) {
    report.insert(0,s + "String_Node_Str");
    JOptionPane.showMessageDialog(this,report,LocalText.getText("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
  }
}
Program: 173627
Project: 173627
Buggy source:
public void keyPressed(KeyEvent e){
  if (e.getKeyCode() == KeyEvent.VK_F1) {
    HelpWindow.displayHelp(GameManager.getInstance().getHelp());
    e.consume();
  }
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  if (e.getKeyCode() == KeyEvent.VK_F1) {
    HelpWindow.displayHelp(gameUIManager.getGameManager().getHelp());
    e.consume();
  }
}
Program: 173629
Project: 173629
Buggy source:
public int getOperatingCompanyIndex(){
  return operatingCompanies.indexOf(getOperatingCompany());
}

Fixed version (ground truth):
public int getOperatingCompanyIndex(){
  int index=operatingCompanies.indexOf(getOperatingCompany());
  return index;
}
Program: 173630
Project: 173630
Buggy source:
public AddToList(List<E> list,E object,String listName){
  this(list,object,listName,null);
}

Fixed version (ground truth):
public AddToList(List<E> list,E object,int index,String listName){
  this.object=object;
  this.list=list;
  this.listName=listName;
  this.index=index;
  MoveSet.add(this);
}
Program: 173631
Project: 173631
Buggy source:
public void add(int index,E element){
  new AddToList<E>(list,element,listName).atIndex(index);
}

Fixed version (ground truth):
public void add(int index,E element){
  new AddToList<E>(list,element,index,listName);
}
Program: 173632
Project: 173632
Buggy source:
public boolean isTileColourAllowed(String tileColour){
  return tileColours.containsKey(tileColour);
}

Fixed version (ground truth):
public boolean isTileColourAllowed(String tileColour){
  return tileColours != null && tileColours.containsKey(tileColour) && tileColours.get(tileColour) > 0;
}
Program: 173633
Project: 173633
Buggy source:
public void setTileColours(Map<String,Integer> map){
  tileColours=map;
}

Fixed version (ground truth):
public void setTileColours(Map<String,Integer> map){
  tileColours=new HashMap<String,Integer>();
  for (  String colourName : map.keySet()) {
    if (map.get(colourName) > 0)     tileColours.put(colourName,map.get(colourName));
  }
}
Program: 173634
Project: 173634
Buggy source:
public void populate(){
  if (hexMap == null)   hexMap=orUIManager.getMapPanel().getMap();
  GUIHex uiHex=hexMap.getSelectedHex();
  MapHex hex=uiHex.getHexModel();
  orUIManager.tileUpgrades=new ArrayList<TileI>();
  List<TileI> tiles;
  for (  LayTile layTile : hexMap.getTileAllowancesForHex(hex)) {
    tiles=layTile.getTiles();
    if (tiles == null) {
      for (      TileI tile : uiHex.getCurrentTile().getValidUpgrades(hex,orUIManager.gameUIManager.getCurrentPhase())) {
        if (!orUIManager.tileUpgrades.contains(tile))         orUIManager.tileUpgrades.add(tile);
      }
    }
 else {
      for (      TileI tile : tiles) {
        if (tile.getColourNumber() <= uiHex.getCurrentTile().getColourNumber())         continue;
        if (!orUIManager.tileUpgrades.contains(tile))         orUIManager.tileUpgrades.add(tile);
      }
    }
  }
}

Fixed version (ground truth):
public void populate(){
  if (hexMap == null)   hexMap=orUIManager.getMapPanel().getMap();
  GUIHex uiHex=hexMap.getSelectedHex();
  MapHex hex=uiHex.getHexModel();
  orUIManager.tileUpgrades=new ArrayList<TileI>();
  List<TileI> tiles;
  for (  LayTile layTile : hexMap.getTileAllowancesForHex(hex)) {
    tiles=layTile.getTiles();
    if (tiles == null) {
      for (      TileI tile : uiHex.getCurrentTile().getValidUpgrades(hex,orUIManager.gameUIManager.getCurrentPhase())) {
        if (!layTile.isTileColourAllowed(tile.getColourName()))         continue;
        if (!orUIManager.tileUpgrades.contains(tile))         orUIManager.tileUpgrades.add(tile);
      }
    }
 else {
      for (      TileI tile : tiles) {
        if (layTile.getTileColours().get(tile.getColourName()) < 1)         continue;
        if (!layTile.isTileColourAllowed(tile.getColourName()))         continue;
        if (!orUIManager.tileUpgrades.contains(tile))         orUIManager.tileUpgrades.add(tile);
      }
    }
  }
}
Program: 173635
Project: 173635
Buggy source:
public void setSkipDone(){
  skipNextDone=true;
}

Fixed version (ground truth):
public void setSkipDone(GameDef.OrStep step){
  skipNextDone=true;
  skippedStep=step;
}
Program: 173637
Project: 173637
Buggy source:
public void setSkipDone();

Fixed version (ground truth):
public void setSkipDone(GameDef.OrStep step);
Program: 173639
Project: 173639
Buggy source:
public void setGameUIManager(GameUIManager gameUIManager){
  this.gameUIManager=gameUIManager;
}

Fixed version (ground truth):
public void setGameUIManager(GameUIManager gameUIManager){
  this.gameUIManager=gameUIManager;
  this.tileManager=gameUIManager.getGameManager().getTileManager();
}
Program: 173640
Project: 173640
Buggy source:
public GUITile(int tileId,GUIHex guiHex){
  this.guiHex=guiHex;
  this.tileId=tileId;
  this.hex=(MapHex)guiHex.getModel();
  tile=GameManager.getInstance().getTileManager().getTile(tileId);
  if (hex.getTileOrientation() == MapHex.EW) {
    baseRotation=0.5 * DEG60;
  }
 else {
    baseRotation=0.0;
  }
}

Fixed version (ground truth):
public GUITile(int tileId,GUIHex guiHex){
  this.guiHex=guiHex;
  this.tileId=tileId;
  this.hex=(MapHex)guiHex.getModel();
  TileManager tileManager=guiHex.getHexMap().orUIManager.getTileManager();
  tile=tileManager.getTile(tileId);
  if (hex.getTileOrientation() == MapHex.EW) {
    baseRotation=0.5 * DEG60;
  }
 else {
    baseRotation=0.0;
  }
}
Program: 173641
Project: 173641
Buggy source:
public void paintTile(Graphics2D g2,int x,int y){
  int zoomStep=guiHex.getHexMap().getZoomStep();
  tileImage=imageLoader.getTile(tileId,zoomStep);
  if (tileImage != null) {
    double radians=baseRotation + rotation * DEG60;
    int xCenter=(int)Math.round(tileImage.getWidth() * SVG_X_CENTER_LOC * tileScale);
    int yCenter=(int)Math.round(tileImage.getHeight() * SVG_Y_CENTER_LOC * tileScale);
    af=AffineTransform.getRotateInstance(radians,xCenter,yCenter);
    af.scale(tileScale,tileScale);
    RenderingHints rh=new RenderingHints(null);
    rh.put(RenderingHints.KEY_ALPHA_INTERPOLATION,RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
    rh.put(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
    rh.put(RenderingHints.KEY_COLOR_RENDERING,RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    rh.put(RenderingHints.KEY_DITHERING,RenderingHints.VALUE_DITHER_DISABLE);
    rh.put(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    rh.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
    rh.put(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    AffineTransformOp aop=new AffineTransformOp(af,rh);
    g2.drawImage(tileImage,aop,x - xCenter,y - yCenter);
  }
}

Fixed version (ground truth):
public void paintTile(Graphics2D g2,int x,int y){
  int zoomStep=guiHex.getHexMap().getZoomStep();
  tileImage=imageLoader.getTile(tileId,zoomStep);
  if (tileImage != null) {
    double radians=baseRotation + rotation * DEG60;
    int xCenter=(int)Math.round(tileImage.getWidth() * SVG_X_CENTER_LOC * tileScale);
    int yCenter=(int)Math.round(tileImage.getHeight() * SVG_Y_CENTER_LOC * tileScale);
    af=AffineTransform.getRotateInstance(radians,xCenter,yCenter);
    af.scale(tileScale,tileScale);
    RenderingHints rh=new RenderingHints(null);
    rh.put(RenderingHints.KEY_ALPHA_INTERPOLATION,RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
    rh.put(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
    rh.put(RenderingHints.KEY_COLOR_RENDERING,RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    rh.put(RenderingHints.KEY_DITHERING,RenderingHints.VALUE_DITHER_DISABLE);
    rh.put(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    rh.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
    rh.put(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    AffineTransformOp aop=new AffineTransformOp(af,rh);
    g2.drawImage(tileImage,aop,x - xCenter,y - yCenter);
  }
 else {
    log.error("String_Node_Str" + tileId + "String_Node_Str"+ guiHex.getName());
  }
}
Program: 173642
Project: 173642
Buggy source:
static void loadGame(String[] args){
  Game game=null;
  String filepath=args[0];
  System.out.println("String_Node_Str" + filepath);
  if ((game=Game.load(filepath)) == null) {
    System.err.println("String_Node_Str" + filepath + "String_Node_Str");
    return;
  }
  GameManagerI gameManager=game.getGameManager();
  GameUIManager gameUIManager;
  String gameUIManagerClassName=gameManager.getClassName(GuiDef.ClassName.GAME_UI_MANAGER);
  try {
    Class<? extends GameUIManager> gameUIManagerClass=Class.forName(gameUIManagerClassName).asSubclass(GameUIManager.class);
    gameUIManager=gameUIManagerClass.newInstance();
    gameUIManager.init(gameManager);
    gameUIManager.startLoadedGame();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + gameUIManagerClassName + "String_Node_Str"+ e.getMessage());
    e.printStackTrace(System.err);
    System.exit(1);
  }
}

Fixed version (ground truth):
static void loadGame(String[] args){
  Game game=null;
  String filepath=args[0];
  System.out.println("String_Node_Str" + filepath);
  if ((game=Game.load(filepath)) == null) {
    System.err.println("String_Node_Str" + filepath + "String_Node_Str");
    return;
  }
  GameManagerI gameManager=game.getGameManager();
  GameUIManager gameUIManager;
  String gameUIManagerClassName=gameManager.getClassName(GuiDef.ClassName.GAME_UI_MANAGER);
  try {
    Class<? extends GameUIManager> gameUIManagerClass=Class.forName(gameUIManagerClassName).asSubclass(GameUIManager.class);
    gameUIManager=gameUIManagerClass.newInstance();
    gameUIManager.init(gameManager);
    String directory=new java.io.File(filepath).getParent();
    if (directory != null) {
      gameUIManager.setSaveDirectory(directory);
    }
    gameUIManager.startLoadedGame();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + gameUIManagerClassName + "String_Node_Str"+ e.getMessage());
    e.printStackTrace(System.err);
    System.exit(1);
  }
}
Program: 173643
Project: 173643
Buggy source:
public static void main(String[] args){
  Config.setConfigSelection();
  int nargs=0;
  if (args != null && args.length > 0) {
    nargs=args.length;
    System.out.println("String_Node_Str" + nargs);
    for (    String arg : args) {
      System.out.println("String_Node_Str" + arg);
    }
  }
  if (nargs >= 1) {
    loadGame(args);
  }
 else {
    new GameSetupWindow();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  Config.setConfigSelection();
  int nargs=0;
  if (args != null && args.length > 0) {
    nargs=args.length;
    System.out.println("String_Node_Str" + nargs);
    for (    String arg : args) {
      System.out.println("String_Node_Str" + arg);
    }
  }
  if (nargs >= 1) {
    loadGameOnEventQueue(args);
  }
 else {
    new GameSetupWindow();
  }
}
Program: 173644
Project: 173644
Buggy source:
public boolean mustSelectAPrice(){
  return startPrices != null && startPrices.length > 1;
}

Fixed version (ground truth):
public boolean mustSelectAPrice(){
  return startPrices != null;
}
Program: 173646
Project: 173646
Buggy source:
/** 
 * Distribute the dividend amongst the shareholders.
 * @param amount
 */
public void payout(int amount){
  if (amount == 0)   return;
  int part;
  int shares;
  Map<CashHolder,Integer> sharesPerRecipient=countSharesPerRecipient();
  Set<CashHolder> recipientSet=sharesPerRecipient.keySet();
  for (  CashHolder recipient : SequenceUtil.sortCashHolders(recipientSet)) {
    if (recipient instanceof Bank)     continue;
    shares=(sharesPerRecipient.get(recipient));
    if (shares == 0)     continue;
    part=(int)Math.ceil(amount * shares * operatingCompany.get().getShareUnit() / 100.0);
    ReportBuffer.add(LocalText.getText("String_Node_Str",recipient.getName(),Bank.format(part),shares,operatingCompany.get().getShareUnit()));
    new CashMove(bank,recipient,part);
  }
  operatingCompany.get().payout(amount);
}

Fixed version (ground truth):
/** 
 * Distribute the dividend amongst the shareholders.
 * @param amount
 */
public void payout(int amount){
  if (amount == 0)   return;
  int part;
  int shares;
  Map<CashHolder,Integer> sharesPerRecipient=countSharesPerRecipient();
  Set<CashHolder> recipientSet=sharesPerRecipient.keySet();
  for (  CashHolder recipient : SequenceUtil.sortCashHolders(recipientSet)) {
    if (recipient instanceof Bank)     continue;
    shares=(sharesPerRecipient.get(recipient));
    if (shares == 0)     continue;
    part=(int)Math.ceil(amount * shares * operatingCompany.get().getShareUnit() / 100.0);
    ReportBuffer.add(LocalText.getText("String_Node_Str",recipient.getName(),Bank.format(part),shares,operatingCompany.get().getShareUnit()));
    pay(bank,recipient,part);
  }
  operatingCompany.get().payout(amount);
}
Program: 173647
Project: 173647
Buggy source:
/** 
 * Split a dividend. TODO Optional rounding down the payout
 * @param amount
 */
public void splitRevenue(int amount){
  if (amount > 0) {
    int numberOfShares=operatingCompany.get().getNumberOfShares();
    int withheld=(amount / (2 * numberOfShares)) * numberOfShares;
    new CashMove(bank,operatingCompany.get(),withheld);
    ReportBuffer.add(operatingCompany.get().getName() + "String_Node_Str" + Bank.format(withheld));
    int payed=amount - withheld;
    payout(payed);
  }
}

Fixed version (ground truth):
/** 
 * Split a dividend. TODO Optional rounding down the payout
 * @param amount
 */
public void splitRevenue(int amount){
  if (amount > 0) {
    int numberOfShares=operatingCompany.get().getNumberOfShares();
    int withheld=(amount / (2 * numberOfShares)) * numberOfShares;
    pay(bank,operatingCompany.get(),withheld);
    ReportBuffer.add(operatingCompany.get().getName() + "String_Node_Str" + Bank.format(withheld));
    int payed=amount - withheld;
    payout(payed);
  }
}
Program: 173648
Project: 173648
Buggy source:
/** 
 * Withhold a given amount of revenue (and store it).
 * @param The revenue amount.
 */
public void withhold(int amount){
  if (amount > 0)   new CashMove(bank,operatingCompany.get(),amount);
  operatingCompany.get().withhold(amount);
}

Fixed version (ground truth):
/** 
 * Withhold a given amount of revenue (and store it).
 * @param The revenue amount.
 */
public void withhold(int amount){
  PublicCompanyI company=operatingCompany.get();
  pay(bank,company,amount);
  company.withhold(amount);
  StockSpaceI newSpace=company.getCurrentSpace();
  if (newSpace.closesCompany() && company.canClose()) {
    company.setClosed();
    ReportBuffer.add(LocalText.getText("String_Node_Str",company.getName(),newSpace.getName()));
    finishTurn();
    return;
  }
}
Program: 173649
Project: 173649
Buggy source:
protected void moveLeftOrDown(PublicCompanyI company){
  StockSpaceI oldsquare=company.getCurrentSpace();
  StockSpaceI newsquare=oldsquare;
  int row=oldsquare.getRow();
  int col=oldsquare.getColumn();
  if (col > 0 && (newsquare=getStockSpace(row,col - 1)) != null) {
  }
 else   if (row < numRows - 1 && (newsquare=getStockSpace(row + 1,col)) != null) {
  }
 else {
    newsquare=oldsquare;
  }
  if (newsquare.closesCompany()) {
    if (!company.canClose())     return;
    company.setClosed();
    oldsquare.removeToken(company);
    ReportBuffer.add(LocalText.getText("String_Node_Str",company.getName(),newsquare.getName()));
  }
 else {
    prepareMove(company,oldsquare,newsquare);
  }
}

Fixed version (ground truth):
protected void moveLeftOrDown(PublicCompanyI company){
  StockSpaceI oldsquare=company.getCurrentSpace();
  StockSpaceI newsquare=oldsquare;
  int row=oldsquare.getRow();
  int col=oldsquare.getColumn();
  if (col > 0 && (newsquare=getStockSpace(row,col - 1)) != null) {
  }
 else   if (row < numRows - 1 && (newsquare=getStockSpace(row + 1,col)) != null) {
  }
 else {
    newsquare=oldsquare;
  }
  prepareMove(company,oldsquare,newsquare);
}
Program: 173651
Project: 173651
Buggy source:
private void importProfile(){
  String directory=Config.get("String_Node_Str");
  JFileChooser fc=new JFileChooser(directory);
  fc.setFileFilter(new FileFilter(){
    public boolean accept(    File f){
      return f.isDirectory() || f.getName().toLowerCase().endsWith(CONFIG_EXTENSION) || f.getName().toLowerCase().endsWith(LEGACY_EXTENSION);
    }
    public String getDescription(){
      return CONFIG_DESCRIPTION;
    }
  }
);
  int state=fc.showOpenDialog(this);
  if (state == JFileChooser.APPROVE_OPTION) {
    File file=fc.getSelectedFile();
    if (Config.importProfileFromFile(file)) {
      changeProfile(Config.getActiveProfileName());
    }
 else {
      JOptionPane.showMessageDialog(ConfigWindow.this,LocalText.getText("String_Node_Str",Config.getActiveProfileName()),LocalText.getText("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    }
  }
}

Fixed version (ground truth):
private void importProfile(){
  String directory=Config.get("String_Node_Str");
  JFileChooser fc=new JFileChooser(directory);
  fc.setFileFilter(new FileFilter(){
    public boolean accept(    File f){
      return f.isDirectory() || f.getName().toLowerCase().endsWith(CONFIG_EXTENSION) || f.getName().toLowerCase().endsWith(LEGACY_EXTENSION);
    }
    public String getDescription(){
      return CONFIG_DESCRIPTION;
    }
  }
);
  int state=fc.showOpenDialog(this);
  if (state == JFileChooser.APPROVE_OPTION) {
    File file=fc.getSelectedFile();
    if (Config.importProfileFromFile(file)) {
      repaintLater();
    }
 else {
      JOptionPane.showMessageDialog(ConfigWindow.this,LocalText.getText("String_Node_Str",Config.getActiveProfileName()),LocalText.getText("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
    }
  }
}
Program: 173652
Project: 173652
Buggy source:
private void changeProfile(String profileName){
  Config.changeActiveProfile(profileName);
  EventQueue.invokeLater(new Runnable(){
    public void run(){
      init();
      ConfigWindow.this.repaint();
    }
  }
);
}

Fixed version (ground truth):
private void changeProfile(String profileName){
  Config.changeActiveProfile(profileName);
  repaintLater();
}
Program: 173653
Project: 173653
Buggy source:
/** 
 * loads an external user profile defined by the filepath
 */
public static boolean importProfileFromFile(File file){
  String filepath=file.getPath();
  if (loadPropertyFile(userProperties,filepath,false)) {
    String profile=userProperties.getProperty(PROFILENAME_PROPERTY);
    if (!Util.hasValue(profile)) {
      profile=STANDARD_PROFILE_SELECTION;
    }
    selectedProfile=profile;
    loadDefaultProfile();
    setSaveDirDefaults();
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * imports an external user profile into an existing profile defined by the filepath
 */
public static boolean importProfileFromFile(File file){
  String filepath=file.getPath();
  Properties importProperties=new Properties();
  if (loadPropertyFile(importProperties,filepath,false)) {
    userProperties.putAll(importProperties);
    setSaveDirDefaults();
    return true;
  }
 else {
    return false;
  }
}
Program: 173654
Project: 173654
Buggy source:
Set<RevenueDynamicModifier> callDynamicModifiers(RevenueAdapter revenueAdapter){
  Set<RevenueDynamicModifier> activeModifiers=new HashSet<RevenueDynamicModifier>();
  for (  RevenueDynamicModifier modifier : dynamicModifiers) {
    if (modifier.prepareModifier(revenueAdapter))     activeModifiers.add(modifier);
  }
  return activeModifiers;
}

Fixed version (ground truth):
Set<RevenueDynamicModifier> callDynamicModifiers(RevenueAdapter revenueAdapter){
  Set<RevenueDynamicModifier> activeModifiers=new HashSet<RevenueDynamicModifier>();
  for (  RevenueDynamicModifier modifier : dynamicModifiers.viewSet()) {
    if (modifier.prepareModifier(revenueAdapter))     activeModifiers.add(modifier);
  }
  return activeModifiers;
}
Program: 173655
Project: 173655
Buggy source:
public RevenueManager(){
  graphModifiers=new HashSet<NetworkGraphModifier>();
  staticModifiers=new HashSet<RevenueStaticModifier>();
  dynamicModifiers=new HashSet<RevenueDynamicModifier>();
  configurableModifiers=new HashSet<ConfigurableComponentI>();
}

Fixed version (ground truth):
public RevenueManager(){
  graphModifiers=new HashSetState<NetworkGraphModifier>("String_Node_Str");
  staticModifiers=new HashSetState<RevenueStaticModifier>("String_Node_Str");
  dynamicModifiers=new HashSetState<RevenueDynamicModifier>("String_Node_Str");
  configurableModifiers=new HashSet<ConfigurableComponentI>();
}
Program: 173656
Project: 173656
Buggy source:
void callGraphModifiers(NetworkGraphBuilder graphBuilder){
  for (  NetworkGraphModifier modifier : graphModifiers) {
    modifier.modifyGraph(graphBuilder);
  }
}

Fixed version (ground truth):
void callGraphModifiers(NetworkGraphBuilder graphBuilder){
  for (  NetworkGraphModifier modifier : graphModifiers.viewSet()) {
    modifier.modifyGraph(graphBuilder);
  }
}
Program: 173657
Project: 173657
Buggy source:
void callStaticModifiers(RevenueAdapter revenueAdapter){
  for (  RevenueStaticModifier modifier : staticModifiers) {
    modifier.modifyCalculator(revenueAdapter);
  }
}

Fixed version (ground truth):
void callStaticModifiers(RevenueAdapter revenueAdapter){
  for (  RevenueStaticModifier modifier : staticModifiers.viewSet()) {
    modifier.modifyCalculator(revenueAdapter);
  }
}
Program: 173658
Project: 173658
Buggy source:
/** 
 * Remove the token. This method can be called by a certain phase when it starts. See prepareForRemovel().
 */
public void close(){
  owner.removeBonus(name);
  GameManager.getInstance().getRevenueManager().removeStaticModifier(this);
}

Fixed version (ground truth):
/** 
 * Remove the bonus This method can be called by a certain phase when it starts. See prepareForRemovel().
 */
public void close(){
  GameManager.getInstance().getRevenueManager().removeStaticModifier(this);
}
Program: 173659
Project: 173659
Buggy source:
@Override public boolean undo(){
  list.add(index,object);
  return true;
}

Fixed version (ground truth):
@Override public boolean undo(){
  list.add(index,object);
  updateModels();
  return true;
}
Program: 173660
Project: 173660
Buggy source:
@Override public boolean execute(){
  list.remove(object);
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(){
  list.remove(object);
  updateModels();
  return true;
}
Program: 173661
Project: 173661
Buggy source:
public void actionPerformed(ActionEvent e){
  ActionButton button=(ActionButton)e.getSource();
  GameAction action=(GameAction)button.getPossibleActions().get(0);
  gameUIManager.processOnServer(action);
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  ActionButton button=(ActionButton)e.getSource();
  GameAction action=(GameAction)button.getPossibleActions().get(0);
  if (action instanceof GameAction && (action.getMode() == GameAction.FORCED_UNDO)) {
    if (!timeWarpMode) {
      activateTimeWarp();
    }
  }
  gameUIManager.processOnServer(action);
}
Program: 173662
Project: 173662
Buggy source:
public void hyperlinkUpdate(HyperlinkEvent e){
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    URL url=e.getURL();
    int index=url.getPort();
    gotoIndex(index + 1);
  }
}

Fixed version (ground truth):
public void hyperlinkUpdate(HyperlinkEvent e){
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    URL url=e.getURL();
    int index=url.getPort();
    gotoIndex(index + 1);
    if (!timeWarpMode) {
      activateTimeWarp();
    }
  }
}
Program: 173663
Project: 173663
Buggy source:
@Override public void updateLog(){
  editorPane.setText(ReportBuffer.getReportItems());
  scrollDown();
  forwardButton.setEnabled(false);
  backwardButton.setEnabled(false);
  boolean haveRedo=false;
  List<GameAction> gameActions=PossibleActions.getInstance().getType(GameAction.class);
  for (  GameAction action : gameActions) {
switch (action.getMode()) {
case GameAction.UNDO:
case GameAction.FORCED_UNDO:
      backwardButton.setPossibleAction(action);
    backwardButton.setEnabled(true);
  break;
case GameAction.REDO:
forwardButton.setPossibleAction(action);
forwardButton.setEnabled(true);
haveRedo=true;
if (!timeWarpMode) activateTimeWarp();
break;
}
}
if (!haveRedo) deactivateTimeWarp();
}

Fixed version (ground truth):
@Override public void updateLog(){
  editorPane.setText(ReportBuffer.getReportItems());
  scrollDown();
  forwardButton.setEnabled(false);
  backwardButton.setEnabled(false);
  boolean haveRedo=false;
  List<GameAction> gameActions=PossibleActions.getInstance().getType(GameAction.class);
  boolean undoFlag=false;
  for (  GameAction action : gameActions) {
switch (action.getMode()) {
case GameAction.UNDO:
      undoFlag=true;
    backwardButton.setPossibleAction(action);
  backwardButton.setEnabled(true);
break;
case GameAction.FORCED_UNDO:
if (undoFlag) break;
backwardButton.setPossibleAction(action);
backwardButton.setEnabled(true);
break;
case GameAction.REDO:
forwardButton.setPossibleAction(action);
forwardButton.setEnabled(true);
haveRedo=true;
break;
}
}
if (!haveRedo) deactivateTimeWarp();
}
Program: 173665
Project: 173665
Buggy source:
public boolean isHomeFor(PublicCompanyI company){
  boolean result=homes != null && homes.get(company) != null;
  return result;
}

Fixed version (ground truth):
public boolean isHomeFor(PublicCompanyI company){
  boolean result=homes != null && homes.containsKey(company);
  return result;
}
Program: 173666
Project: 173666
Buggy source:
@Override public String toString(){
  StringBuffer b=new StringBuffer();
  b.append(company.getName());
  b.append("String_Node_Str").append(getTrain().getName());
  b.append("String_Node_Str").append(from.getName());
  if (fixedCost > 0) {
    b.append("String_Node_Str").append(Bank.format(fixedCost));
  }
 else {
    b.append("String_Node_Str");
  }
  if (specialProperty != null) {
    b.append("String_Node_Str").append(specialProperty.getOriginalCompany().getName());
  }
  if (isForExchange()) {
    b.append(forcedExchange ? "String_Node_Str" : "String_Node_Str");
  }
  if (presidentMustAddCash) {
    b.append("String_Node_Str").append(Bank.format(presidentCashToAdd));
  }
 else   if (presidentMayAddCash) {
    b.append("String_Node_Str").append(Bank.format(presidentCashToAdd));
  }
  if (acted) {
    b.append("String_Node_Str").append(Bank.format(pricePaid));
    if (addedCash > 0)     b.append("String_Node_Str" + Bank.format(addedCash));
    if (exchangedTrain != null)     b.append("String_Node_Str" + exchangedTrain.getName() + "String_Node_Str");
  }
  return b.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer b=new StringBuffer();
  b.append(company.getName());
  if (train != null) {
    b.append("String_Node_Str").append(getTrain().getName());
  }
 else {
    b.append("String_Node_Str").append(trainUniqueId);
  }
  b.append("String_Node_Str").append(from.getName());
  if (fixedCost > 0) {
    b.append("String_Node_Str").append(Bank.format(fixedCost));
  }
 else {
    b.append("String_Node_Str");
  }
  if (specialProperty != null) {
    b.append("String_Node_Str").append(specialProperty.getOriginalCompany().getName());
  }
  if (isForExchange()) {
    b.append(forcedExchange ? "String_Node_Str" : "String_Node_Str");
  }
  if (presidentMustAddCash) {
    b.append("String_Node_Str").append(Bank.format(presidentCashToAdd));
  }
 else   if (presidentMayAddCash) {
    b.append("String_Node_Str").append(Bank.format(presidentCashToAdd));
  }
  if (acted) {
    b.append("String_Node_Str").append(Bank.format(pricePaid));
    if (addedCash > 0)     b.append("String_Node_Str" + Bank.format(addedCash));
    if (exchangedTrain != null)     b.append("String_Node_Str" + exchangedTrain.getName() + "String_Node_Str");
  }
  return b.toString();
}
Program: 173667
Project: 173667
Buggy source:
public void removeTile(){
  provisionalGUITile=null;
  setSelected(false);
  setToolTip();
}

Fixed version (ground truth):
public void removeTile(){
  provisionalGUITile=null;
  setSelected(false);
  toolTip=null;
}
Program: 173668
Project: 173668
Buggy source:
public void removeToken(){
  provisionalGUIToken=null;
  setSelected(false);
  setToolTip();
}

Fixed version (ground truth):
public void removeToken(){
  provisionalGUIToken=null;
  setSelected(false);
  toolTip=null;
}
Program: 173669
Project: 173669
Buggy source:
public void setHexModel(MapHex model){
  this.model=model;
  currentTile=model.getCurrentTile();
  hexName=model.getName();
  currentTileId=model.getCurrentTile().getId();
  currentTileOrientation=model.getCurrentTileRotation();
  currentGUITile=new GUITile(currentTileId,this);
  currentGUITile.setRotation(currentTileOrientation);
  setToolTip();
  model.addObserver(this);
}

Fixed version (ground truth):
public void setHexModel(MapHex model){
  this.model=model;
  currentTile=model.getCurrentTile();
  hexName=model.getName();
  currentTileId=model.getCurrentTile().getId();
  currentTileOrientation=model.getCurrentTileRotation();
  currentGUITile=new GUITile(currentTileId,this);
  currentGUITile.setRotation(currentTileOrientation);
  toolTip=null;
  model.addObserver(this);
}
Program: 173670
Project: 173670
Buggy source:
public void fixTile(){
  setSelected(false);
  setToolTip();
}

Fixed version (ground truth):
public void fixTile(){
  setSelected(false);
  toolTip=null;
}
Program: 173671
Project: 173671
Buggy source:
public void fixToken(){
  setSelected(false);
  setToolTip();
}

Fixed version (ground truth):
public void fixToken(){
  setSelected(false);
  toolTip=null;
}
Program: 173672
Project: 173672
Buggy source:
public String getToolTip(){
  return toolTip;
}

Fixed version (ground truth):
public String getToolTip(){
  if (toolTip != null)   return toolTip;
 else   return getDefaultToolTip();
}
Program: 173673
Project: 173673
Buggy source:
public void updateOffBoardToolTips(){
  for (  GUIHex hex : hexes) {
    if (hex.getHexModel().hasOffBoardValues()) {
      hex.setToolTip();
    }
  }
}

Fixed version (ground truth):
public void updateOffBoardToolTips(){
}
Program: 173675
Project: 173675
Buggy source:
public void gameUIInit(){
  imageLoader=new ImageLoader();
  stockChart=new StockChart(this);
  if (Config.get("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
    reportWindow=new ReportWindow(gameManager);
  }
 else {
    reportWindow=new ReportWindowDynamic(this);
  }
  orWindow=new ORWindow(this);
  orUIManager=orWindow.getORUIManager();
  String statusWindowClassName=getClassName(GuiDef.ClassName.STATUS_WINDOW);
  try {
    Class<? extends StatusWindow> statusWindowClass=Class.forName(statusWindowClassName).asSubclass(StatusWindow.class);
    statusWindow=statusWindowClass.newInstance();
    statusWindow.init(this);
  }
 catch (  Exception e) {
    log.fatal("String_Node_Str" + statusWindowClassName,e);
    System.exit(1);
  }
  reportWindow.scrollDown();
  configWindow=new ConfigWindow();
  configWindow.init();
}

Fixed version (ground truth):
public void gameUIInit(boolean newGame){
  imageLoader=new ImageLoader();
  stockChart=new StockChart(this);
  if (Config.get("String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
    reportWindow=new ReportWindow(gameManager);
  }
 else {
    reportWindow=new ReportWindowDynamic(this);
  }
  orWindow=new ORWindow(this);
  orUIManager=orWindow.getORUIManager();
  String statusWindowClassName=getClassName(GuiDef.ClassName.STATUS_WINDOW);
  try {
    Class<? extends StatusWindow> statusWindowClass=Class.forName(statusWindowClassName).asSubclass(StatusWindow.class);
    statusWindow=statusWindowClass.newInstance();
    statusWindow.init(this);
  }
 catch (  Exception e) {
    log.fatal("String_Node_Str" + statusWindowClassName,e);
    System.exit(1);
  }
  if (newGame) {
    updateUI();
  }
  reportWindow.scrollDown();
  configWindow=new ConfigWindow();
  configWindow.init();
}
Program: 173676
Project: 173676
Buggy source:
public void startLoadedGame(){
  gameUIInit();
  processOnServer(new NullAction(NullAction.START_GAME));
  statusWindow.setGameActions();
}

Fixed version (ground truth):
public void startLoadedGame(){
  gameUIInit(false);
  processOnServer(new NullAction(NullAction.START_GAME));
  statusWindow.setGameActions();
}
Program: 173677
Project: 173677
Buggy source:
public String getOptimalRunPrettyPrint(boolean includeDetails){
  List<RevenueTrainRun> listRuns=getOptimalRun();
  if (listRuns == null)   return LocalText.getText("String_Node_Str");
  StringBuffer runPrettyPrint=new StringBuffer();
  for (  RevenueTrainRun run : listRuns) {
    runPrettyPrint.append(run.prettyPrint(includeDetails));
    if (includeDetails)     runPrettyPrint.append("String_Node_Str");
 else     if (run != listRuns.get(listRuns.size() - 1))     runPrettyPrint.append("String_Node_Str");
  }
  if (includeDetails) {
    for (    RevenueDynamicModifier modifier : dynamicModifiers) {
      runPrettyPrint.append(modifier.prettyPrint(this));
    }
  }
 else {
    int dynamicBonuses=0;
    for (    RevenueDynamicModifier modifier : dynamicModifiers) {
      dynamicBonuses+=modifier.evaluationValue(this.getOptimalRun());
    }
    if (dynamicBonuses != 0) {
      runPrettyPrint.append("String_Node_Str" + LocalText.getText("String_Node_Str",dynamicBonuses));
    }
  }
  return runPrettyPrint.toString();
}

Fixed version (ground truth):
public String getOptimalRunPrettyPrint(boolean includeDetails){
  List<RevenueTrainRun> listRuns=getOptimalRun();
  if (listRuns == null)   return LocalText.getText("String_Node_Str");
  StringBuffer runPrettyPrint=new StringBuffer();
  for (  RevenueTrainRun run : listRuns) {
    runPrettyPrint.append(run.prettyPrint(includeDetails));
    if (!includeDetails && run != listRuns.get(listRuns.size() - 1)) {
      runPrettyPrint.append("String_Node_Str");
    }
  }
  if (includeDetails) {
    for (    RevenueDynamicModifier modifier : dynamicModifiers) {
      runPrettyPrint.append(modifier.prettyPrint(this));
    }
  }
 else {
    int dynamicBonuses=0;
    for (    RevenueDynamicModifier modifier : dynamicModifiers) {
      dynamicBonuses+=modifier.evaluationValue(this.getOptimalRun());
    }
    if (dynamicBonuses != 0) {
      runPrettyPrint.append("String_Node_Str" + LocalText.getText("String_Node_Str",dynamicBonuses));
    }
  }
  return runPrettyPrint.toString();
}
Program: 173678
Project: 173678
Buggy source:
public void revenueUpdate(int bestRevenue,boolean finalResult){
  revenueSelect[orCompIndex].setValue(bestRevenue);
  if (finalResult) {
    revenueAdapter.drawOptimalRunAsPath(orUIManager.getMap());
    orUIManager.getMap().repaint();
    orUIManager.addInformation("String_Node_Str" + bestRevenue + "String_Node_Str"+ revenueAdapter.getOptimalRunPrettyPrint(false));
    orUIManager.addDetail(revenueAdapter.getOptimalRunPrettyPrint(true));
  }
}

Fixed version (ground truth):
public void revenueUpdate(int bestRevenue,boolean finalResult){
  revenueSelect[orCompIndex].setValue(bestRevenue);
  if (finalResult) {
    revenueAdapter.drawOptimalRunAsPath(orUIManager.getMap());
    orUIManager.getMap().repaint();
    orUIManager.addInformation("String_Node_Str" + bestRevenue + "String_Node_Str"+ Util.convertToHtml(revenueAdapter.getOptimalRunPrettyPrint(false)));
    orUIManager.addDetail(Util.convertToHtml(revenueAdapter.getOptimalRunPrettyPrint(true)));
  }
}
Program: 173680
Project: 173680
Buggy source:
public String toFullInfoString(){
  StringBuffer info=new StringBuffer();
  info.append("String_Node_Str" + getConnection());
  info.append("String_Node_Str" + greedy);
  info.append("String_Node_Str" + distance);
  info.append("String_Node_Str" + hiddenVertexes);
  return info.toString();
}

Fixed version (ground truth):
public String toFullInfoString(){
  StringBuffer info=new StringBuffer();
  info.append("String_Node_Str" + getConnection());
  info.append("String_Node_Str" + greedy);
  info.append("String_Node_Str" + distance);
  info.append("String_Node_Str" + hiddenVertices);
  return info.toString();
}
Program: 173681
Project: 173681
Buggy source:
/** 
 * for a given edge it replaces one of the vertices by a different one otherwise copies all edge attributes
 * @return copied edge with replaced vertex, null if oldVertex is neither source, nor target
 */
public static NetworkEdge replaceVertex(NetworkEdge edge,NetworkVertex oldVertex,NetworkVertex newVertex){
  NetworkEdge newEdge;
  if (edge.source == oldVertex) {
    newEdge=new NetworkEdge(newVertex,edge.target,edge.greedy,edge.distance,edge.hiddenVertexes);
  }
 else   if (edge.target == oldVertex) {
    newEdge=new NetworkEdge(edge.source,newVertex,edge.greedy,edge.distance,edge.hiddenVertexes);
  }
 else {
    newEdge=null;
  }
  return newEdge;
}

Fixed version (ground truth):
/** 
 * for a given edge it replaces one of the vertices by a different one otherwise copies all edge attributes
 * @return copied edge with replaced vertex, null if oldVertex is neither source, nor target
 */
public static NetworkEdge replaceVertex(NetworkEdge edge,NetworkVertex oldVertex,NetworkVertex newVertex){
  NetworkEdge newEdge;
  if (edge.source == oldVertex) {
    newEdge=new NetworkEdge(newVertex,edge.target,edge.greedy,edge.distance,edge.hiddenVertices);
  }
 else   if (edge.target == oldVertex) {
    newEdge=new NetworkEdge(edge.source,newVertex,edge.greedy,edge.distance,edge.hiddenVertices);
  }
 else {
    newEdge=null;
  }
  return newEdge;
}
Program: 173682
Project: 173682
Buggy source:
public NetworkEdge(NetworkVertex source,NetworkVertex target,boolean greedy,int distance,List<NetworkVertex> hiddenVertexes){
  this.source=source;
  this.target=target;
  this.greedy=greedy;
  this.distance=distance;
  this.hiddenVertexes=hiddenVertexes;
}

Fixed version (ground truth):
public NetworkEdge(NetworkVertex source,NetworkVertex target,boolean greedy,int distance,List<NetworkVertex> hiddenVertexes){
  this.source=source;
  this.target=target;
  this.greedy=greedy;
  this.distance=distance;
  this.hiddenVertices=hiddenVertexes;
}