nus-yam/ex-repair huggingface dataset:
Program: 173369
Project: 173369
Buggy source:
public int evaluationValue(List<RevenueTrainRun> runs,boolean optimalRuns){
  int value=0;
  for (  RevenueTrainRun run : runs) {
    if ((run.getTrain().getRailsTrainType() != null) && (run.getTrain().getRailsTrainType().getCertificateType().getId().equals("String_Node_Str"))) {
      if (optimalRuns)       log.debug("String_Node_Str" + run.getRunVertices());
      List<NetworkVertex> expressRun=extractExpressRun(run,6);
      if (optimalRuns)       log.debug("String_Node_Str" + expressRun);
      int expressRunValue=NetworkVertex.sum(expressRun);
      value+=expressRunValue - run.getRunValue();
    }
    if ((run.getTrain().getRailsTrainType() != null) && (run.getTrain().getRailsTrainType().getCertificateType().getId().equals("String_Node_Str"))) {
      int expressRunValue=NetworkVertex.sum(extractExpressRun(run,8));
      value+=expressRunValue - run.getRunValue();
    }
  }
  return value;
}

Fixed version (ground truth):
public int evaluationValue(List<RevenueTrainRun> runs,boolean optimalRuns){
  int value=0;
  for (  RevenueTrainRun run : runs) {
    if ((run.getTrain().getRailsTrainType() != null) && (run.getTrain().getRailsTrainType().getCertificateType().getId().equals("String_Node_Str"))) {
      if (optimalRuns)       log.debug("String_Node_Str" + run.getRunVertices());
      List<NetworkVertex> expressRun=extractExpressRun(run,6);
      if (optimalRuns)       log.debug("String_Node_Str" + expressRun);
      int expressRunValue=NetworkVertex.sum(expressRun);
      value+=expressRunValue - run.getRunValue();
    }
    if ((run.getTrain().getRailsTrainType() != null) && (run.getTrain().getRailsTrainType().getCertificateType().getId().equals("String_Node_Str"))) {
      if (optimalRuns)       log.debug("String_Node_Str" + run.getRunVertices());
      List<NetworkVertex> expressRun=extractExpressRun(run,8);
      if (optimalRuns)       log.debug("String_Node_Str" + expressRun);
      int expressRunValue=NetworkVertex.sum(expressRun);
      value+=expressRunValue - run.getRunValue();
    }
  }
  return value;
}
Program: 173370
Project: 173370
Buggy source:
/** 
 * @return True if the map panel expected hex clicks for actions / corrections
 */
public boolean hexClicked(GUIHex clickedHex,GUIHex selectedHex,boolean rightClick){
  if (localStep == null) {
    return false;
  }
  if (selectedHex == clickedHex) {
switch (localStep) {
case SelectUpgrade:
      if (rightClick) {
        upgradePanel.nextUpgrade();
      }
 else {
        upgradePanel.nextSelection();
      }
    return true;
default :
  return false;
}
}
if (clickedHex == null) {
switch (localStep) {
case SelectUpgrade:
if (selectedHex != null) {
  map.selectHex(null);
}
setLocalStep(LocalSteps.SelectHex);
return true;
default :
return false;
}
}
if (hexUpgrades.contains(clickedHex)) {
switch (localStep) {
case SelectHex:
case SelectUpgrade:
map.selectHex(clickedHex);
setLocalStep(LocalSteps.SelectUpgrade);
return true;
default :
return false;
}
}
switch (localStep) {
case SelectHex:
case SelectUpgrade:
map.selectHex(null);
setLocalStep(LocalSteps.SelectHex);
return false;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * @return True if the map panel expected hex clicks for actions / corrections
 */
public boolean hexClicked(GUIHex clickedHex,GUIHex selectedHex,boolean rightClick){
  if (localStep == null) {
    return false;
  }
  if (selectedHex == clickedHex) {
switch (localStep) {
case SelectUpgrade:
      if (rightClick) {
        upgradePanel.nextUpgrade();
      }
 else {
        upgradePanel.nextSelection();
      }
    return true;
default :
  return false;
}
}
if (clickedHex == null) {
switch (localStep) {
case SelectUpgrade:
if (selectedHex != null) {
  map.selectHex(null);
}
setLocalStep(LocalSteps.SelectHex);
return true;
default :
return false;
}
}
if (hexUpgrades.containsVisible(clickedHex)) {
switch (localStep) {
case SelectHex:
case SelectUpgrade:
map.selectHex(clickedHex);
setLocalStep(LocalSteps.SelectUpgrade);
return true;
default :
return false;
}
}
switch (localStep) {
case SelectHex:
case SelectUpgrade:
map.selectHex(null);
setLocalStep(LocalSteps.SelectHex);
return false;
default :
return false;
}
}
Program: 173371
Project: 173371
Buggy source:
public NetworkMultigraph getMultigraph(PublicCompany company,Collection<NetworkVertex> protectedVertices){
  if (multiGraph == null) {
    multiGraph=NetworkMultigraph.create(getRevenueGraph(company,protectedVertices),protectedVertices);
    log.info("String_Node_Str");
  }
  return multiGraph;
}

Fixed version (ground truth):
public NetworkMultigraph getMultigraph(PublicCompany company,Collection<NetworkVertex> protectedVertices){
  return NetworkMultigraph.create(getRevenueGraph(company,protectedVertices),protectedVertices);
}
Program: 173372
Project: 173372
Buggy source:
public NetworkGraph getMapGraph(){
  if (mapGraph == null) {
    mapGraph=NetworkGraph.createMapGraph(root);
    log.info("String_Node_Str");
  }
  return mapGraph;
}

Fixed version (ground truth):
public NetworkGraph getMapGraph(){
  return NetworkGraph.createMapGraph(root);
}
Program: 173373
Project: 173373
Buggy source:
public NetworkGraph getRevenueGraph(PublicCompany company,Collection<NetworkVertex> protectedVertices){
  if (revenueGraph == null) {
    revenueGraph=NetworkGraph.createOptimizedGraph(getRouteGraph(company,false),protectedVertices);
    log.info("String_Node_Str");
  }
  return revenueGraph;
}

Fixed version (ground truth):
public NetworkGraph getRevenueGraph(PublicCompany company,Collection<NetworkVertex> protectedVertices){
  return NetworkGraph.createOptimizedGraph(getRouteGraph(company,false),protectedVertices);
}
Program: 173374
Project: 173374
Buggy source:
public NetworkGraph getRouteGraph(PublicCompany company,boolean addHQ){
  if (routeGraph == null || company != this.company || addHQ != this.addHQ) {
    routeGraph=NetworkGraph.createRouteGraph(getMapGraph(),company,addHQ);
    this.company=company;
    this.addHQ=addHQ;
    log.info("String_Node_Str");
  }
  return routeGraph;
}

Fixed version (ground truth):
public NetworkGraph getRouteGraph(PublicCompany company,boolean addHQ){
  return NetworkGraph.createRouteGraph(getMapGraph(),company,addHQ);
}
Program: 173375
Project: 173375
Buggy source:
public void saveGameStatus(){
  List<String> status=statusWindow.getGameStatus().getTextContents();
  JFileChooser jfc=new JFileChooser();
  String filename=saveDirectory + "String_Node_Str" + savePrefix+ "String_Node_Str"+ saveDateTimeFormat.format(new Date())+ "String_Node_Str";
  File proposedFile=new File(filename);
  jfc.setSelectedFile(proposedFile);
  if (jfc.showSaveDialog(statusWindow) == JFileChooser.APPROVE_OPTION) {
    File selectedFile=jfc.getSelectedFile();
  }
  try {
    PrintWriter pw=new PrintWriter(filename);
    for (    String line : status)     pw.println(line);
    pw.close();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    getDisplayBuffer().add(LocalText.getText("String_Node_Str",e.getMessage()));
  }
}

Fixed version (ground truth):
public void saveGameStatus(){
  List<String> status=statusWindow.getGameStatus().getTextContents();
  JFileChooser jfc=new JFileChooser();
  String filename=saveDirectory + "String_Node_Str" + savePrefix+ "String_Node_Str"+ saveDateTimeFormat.format(new Date())+ "String_Node_Str";
  File proposedFile=new File(filename);
  jfc.setSelectedFile(proposedFile);
  if (jfc.showSaveDialog(statusWindow) == JFileChooser.APPROVE_OPTION) {
    File selectedFile=jfc.getSelectedFile();
    try {
      PrintWriter pw=new PrintWriter(selectedFile);
      for (      String line : status)       pw.println(line);
      pw.close();
    }
 catch (    IOException e) {
      log.error("String_Node_Str",e);
      getDisplayBuffer().add(LocalText.getText("String_Node_Str",e.getMessage()));
    }
  }
}
Program: 173376
Project: 173376
Buggy source:
public void informOnRedo(){
  ReportSet redoSet=futureReports.pollFirst();
  pastReports.addLast(redoSet);
}

Fixed version (ground truth):
@Override public void informOnRedo(){
  ReportSet redoSet=futureReports.pollFirst();
  pastReports.addLast(redoSet);
}
Program: 173377
Project: 173377
Buggy source:
public void informOnUndo(){
  ReportSet undoSet=pastReports.pollLast();
  futureReports.addFirst(undoSet);
}

Fixed version (ground truth):
@Override public void informOnUndo(){
  ReportSet undoSet=pastReports.pollLast();
  futureReports.addFirst(undoSet);
}
Program: 173378
Project: 173378
Buggy source:
public void updateOnClose(ChangeSet current){
  ReportSet currentSet=currentReportBuilder.build(current);
  pastReports.addLast(currentSet);
  futureReports.clear();
  currentText=getAsHtml(current);
  if (observer != null) {
    observer.update(currentText);
  }
  currentReportBuilder=ReportSet.builder();
}

Fixed version (ground truth):
@Override public void updateOnClose(){
  ChangeSet current=changeStack.getClosedChangeSet();
  ReportSet currentSet=currentReportBuilder.build(current);
  pastReports.addLast(currentSet);
  futureReports.clear();
  currentReportBuilder=ReportSet.builder();
  updateObserver();
}
Program: 173379
Project: 173379
Buggy source:
public String getCurrentText(){
  return currentText;
}

Fixed version (ground truth):
public String getCurrentText(){
  return getAsHtml(changeStack.getClosedChangeSet());
}
Program: 173380
Project: 173380
Buggy source:
void updateOnClose(ChangeSet current);

Fixed version (ground truth):
public void updateOnClose();
Program: 173381
Project: 173381
Buggy source:
void informOnRedo();

Fixed version (ground truth):
public void informOnRedo();
Program: 173382
Project: 173382
Buggy source:
void informOnUndo();

Fixed version (ground truth):
public void informOnUndo();
Program: 173383
Project: 173383
Buggy source:
/** 
 * Add ChangeReporter
 */
public void addChangeReporter(ChangeReporter reporter){
  this.reporter=reporter;
  log.debug("String_Node_Str" + reporter);
}

Fixed version (ground truth):
/** 
 * Add ChangeReporter
 */
public void addChangeReporter(ChangeReporter reporter){
  this.reporter=reporter;
  reporter.init(this);
  log.debug("String_Node_Str" + reporter);
}
Program: 173384
Project: 173384
Buggy source:
public void redo(int index){
  checkState(index > undoStack.size() && index <= undoStack.size() + redoStack.size(),"String_Node_Str");
  ImmutableSet.Builder<State> states=ImmutableSet.builder();
  while (undoStack.size() < index) {
    states.addAll(executeRedo().getStates());
  }
  restart();
  updateObservers(states.build());
}

Fixed version (ground truth):
public void redo(int index){
  checkState(index > undoStack.size() && index <= undoStack.size() + redoStack.size(),"String_Node_Str");
  ImmutableSet.Builder<State> states=ImmutableSet.builder();
  while (undoStack.size() < index) {
    states.addAll(executeRedo().getStates());
  }
  restart();
  updateObservers(states.build());
  if (reporter != null) {
    reporter.updateAfterUndoRedo();
  }
}
Program: 173385
Project: 173385
Buggy source:
/** 
 * Example: Undo-Stack has 4 elements (1,2,3,4), size = 4 Undo to index 2, requires removing the latest element, such that size = 3
 */
public void undo(int index){
  checkState(isUndoPossible() && index < undoStack.size(),"String_Node_Str");
  ImmutableSet.Builder<State> states=ImmutableSet.builder();
  while (undoStack.size() > index) {
    states.addAll(executeUndo().getStates());
  }
  restart();
  updateObservers(states.build());
}

Fixed version (ground truth):
/** 
 * Example: Undo-Stack has 4 elements (1,2,3,4), size = 4 Undo to index 2, requires removing the latest element, such that size = 3
 */
public void undo(int index){
  checkState(isUndoPossible() && index < undoStack.size(),"String_Node_Str");
  ImmutableSet.Builder<State> states=ImmutableSet.builder();
  while (undoStack.size() > index) {
    states.addAll(executeUndo().getStates());
  }
  restart();
  updateObservers(states.build());
  if (reporter != null) {
    reporter.updateAfterUndoRedo();
  }
}
Program: 173386
Project: 173386
Buggy source:
public void close(ChangeAction action){
  if (checkRequirementsForClose(action)) {
    int index=undoStack.size() + 1;
    ChangeSet closeSet=new ChangeSet(changeBuilder.build(),action,index);
    log.debug("String_Node_Str" + closeSet);
    undoStack.addLast(closeSet);
    redoStack.clear();
    if (reporter != null) {
      reporter.updateOnClose(closeSet);
    }
    restart();
    updateObservers(closeSet.getStates());
  }
}

Fixed version (ground truth):
public void close(ChangeAction action){
  if (checkRequirementsForClose(action)) {
    int index=undoStack.size() + 1;
    ChangeSet closeSet=new ChangeSet(changeBuilder.build(),action,index);
    log.debug("String_Node_Str" + closeSet);
    undoStack.addLast(closeSet);
    redoStack.clear();
    if (reporter != null) {
      reporter.updateOnClose();
    }
    restart();
    updateObservers(closeSet.getStates());
  }
}
Program: 173387
Project: 173387
Buggy source:
public void updateOnClose(ChangeSet current){
}

Fixed version (ground truth):
@Override public void updateOnClose(){
}
Program: 173388
Project: 173388
Buggy source:
public void informOnRedo(){
}

Fixed version (ground truth):
@Override public void informOnRedo(){
}
Program: 173389
Project: 173389
Buggy source:
public void informOnUndo(){
}

Fixed version (ground truth):
@Override public void informOnUndo(){
}
Program: 173390
Project: 173390
Buggy source:
private void testUndoAfterClose(){
  assertTrue(state.value());
  changeStack.undo();
  assertEquals(2,changeStack.getCurrentIndex());
  assertSame(set_2,changeStack.getPreviousChangeSet());
  assertFalse(state.value());
  changeStack.undo();
  assertEquals(1,changeStack.getCurrentIndex());
  assertSame(set_1,changeStack.getPreviousChangeSet());
  assertTrue(state.value());
  try {
    changeStack.undo();
    failBecauseExceptionWasNotThrown(IllegalStateException.class);
  }
 catch (  Exception e) {
    assertThat(e).isInstanceOf(IllegalStateException.class);
  }
  assertEquals(1,changeStack.getCurrentIndex());
  assertSame(set_1,changeStack.getPreviousChangeSet());
  assertTrue(state.value());
}

Fixed version (ground truth):
private void testUndoAfterClose(){
  assertTrue(state.value());
  changeStack.undo();
  assertEquals(2,changeStack.getCurrentIndex());
  assertSame(set_2,changeStack.getClosedChangeSet());
  assertFalse(state.value());
  changeStack.undo();
  assertEquals(1,changeStack.getCurrentIndex());
  assertSame(set_1,changeStack.getClosedChangeSet());
  assertTrue(state.value());
  try {
    changeStack.undo();
    failBecauseExceptionWasNotThrown(IllegalStateException.class);
  }
 catch (  Exception e) {
    assertThat(e).isInstanceOf(IllegalStateException.class);
  }
  assertEquals(1,changeStack.getCurrentIndex());
  assertSame(set_1,changeStack.getClosedChangeSet());
  assertTrue(state.value());
}
Program: 173391
Project: 173391
Buggy source:
@Test public void testRedo(){
  changeStack.close(changeAction);
  changeStack.undo();
  changeStack.undo();
  changeStack.redo();
  assertEquals(2,changeStack.getCurrentIndex());
  assertSame(set_2,changeStack.getPreviousChangeSet());
  assertFalse(state.value());
  changeStack.redo();
  assertEquals(3,changeStack.getCurrentIndex());
  assertSame(set_3,changeStack.getPreviousChangeSet());
  assertTrue(state.value());
  try {
    changeStack.redo();
    failBecauseExceptionWasNotThrown(IllegalStateException.class);
  }
 catch (  Exception e) {
    assertThat(e).isInstanceOf(IllegalStateException.class);
  }
  assertEquals(3,changeStack.getCurrentIndex());
  assertSame(set_3,changeStack.getPreviousChangeSet());
  assertTrue(state.value());
  testUndoAfterClose();
}

Fixed version (ground truth):
@Test public void testRedo(){
  changeStack.close(changeAction);
  changeStack.undo();
  changeStack.undo();
  changeStack.redo();
  assertEquals(2,changeStack.getCurrentIndex());
  assertSame(set_2,changeStack.getClosedChangeSet());
  assertFalse(state.value());
  changeStack.redo();
  assertEquals(3,changeStack.getCurrentIndex());
  assertSame(set_3,changeStack.getClosedChangeSet());
  assertTrue(state.value());
  try {
    changeStack.redo();
    failBecauseExceptionWasNotThrown(IllegalStateException.class);
  }
 catch (  Exception e) {
    assertThat(e).isInstanceOf(IllegalStateException.class);
  }
  assertEquals(3,changeStack.getCurrentIndex());
  assertSame(set_3,changeStack.getClosedChangeSet());
  assertTrue(state.value());
  testUndoAfterClose();
}
Program: 173392
Project: 173392
Buggy source:
@Before public void setUp(){
  root=Root.create();
  changeStack=root.getStateManager().getChangeStack();
  changeAction=new ChangeActionImpl();
  state=BooleanState.create(root,STATE_ID,true);
  StateTestUtils.close(root);
  set_1=changeStack.getPreviousChangeSet();
  state.set(false);
  StateTestUtils.close(root);
  set_2=changeStack.getPreviousChangeSet();
  state.set(true);
  StateTestUtils.close(root);
  set_3=changeStack.getPreviousChangeSet();
}

Fixed version (ground truth):
@Before public void setUp(){
  root=Root.create();
  changeStack=root.getStateManager().getChangeStack();
  changeAction=new ChangeActionImpl();
  state=BooleanState.create(root,STATE_ID,true);
  StateTestUtils.close(root);
  set_1=changeStack.getClosedChangeSet();
  state.set(false);
  StateTestUtils.close(root);
  set_2=changeStack.getClosedChangeSet();
  state.set(true);
  StateTestUtils.close(root);
  set_3=changeStack.getClosedChangeSet();
}
Program: 173393
Project: 173393
Buggy source:
@Test public void testcloseAndNew(){
  changeStack.close(changeAction);
  assertSame(set_3,changeStack.getPreviousChangeSet());
  assertEquals(3,changeStack.getCurrentIndex());
}

Fixed version (ground truth):
@Test public void testcloseAndNew(){
  changeStack.close(changeAction);
  assertSame(set_3,changeStack.getClosedChangeSet());
  assertEquals(3,changeStack.getCurrentIndex());
}
Program: 173394
Project: 173394
Buggy source:
@Test public void testGetCurrentChangeSet(){
  assertSame(set_3,changeStack.getPreviousChangeSet());
  assertEquals(3,changeStack.getCurrentIndex());
}

Fixed version (ground truth):
@Test public void testGetCurrentChangeSet(){
  assertSame(set_3,changeStack.getClosedChangeSet());
  assertEquals(3,changeStack.getCurrentIndex());
}
Program: 173395
Project: 173395
Buggy source:
public static ChangeSet getPreviousChangeSet(Root root){
  return root.getStateManager().getChangeStack().getPreviousChangeSet();
}

Fixed version (ground truth):
public static ChangeSet getPreviousChangeSet(Root root){
  return root.getStateManager().getChangeStack().getClosedChangeSet();
}
Program: 173398
Project: 173398
Buggy source:
private PrivatesModel(RailsOwner parent,String id){
  super(parent,id);
  privates=PortfolioSet.create(parent,"String_Node_Str",PrivateCompany.class);
}

Fixed version (ground truth):
private PrivatesModel(RailsOwner parent,String id){
  super(parent,id);
  privates=PortfolioSet.create(parent,"String_Node_Str",PrivateCompany.class);
  privates.addModel(this);
}
Program: 173399
Project: 173399
Buggy source:
private void defineTileUpgrades(List<LayTile> actions){
  for (  LayTile layTile : actions) {
switch (layTile.getType()) {
case (LayTile.GENERIC):
      addGenericTileLays(layTile);
    break;
case (LayTile.SPECIAL_PROPERTY):
  SpecialProperty sp=layTile.getSpecialProperty();
if (sp == null || !(sp instanceof SpecialTileLay) || ((SpecialTileLay)sp).requiresConnection()) {
  break;
}
case (LayTile.LOCATION_SPECIFIC):
if (layTile.getLocations() != null) {
addLocatedTileLays(layTile);
}
 else {
addGenericTileLays(layTile);
}
default :
}
}
}

Fixed version (ground truth):
private void defineTileUpgrades(List<LayTile> actions){
  for (  LayTile layTile : actions) {
switch (layTile.getType()) {
case (LayTile.GENERIC):
      addConnectedTileLays(layTile);
    break;
case (LayTile.SPECIAL_PROPERTY):
  SpecialTileLay sp=(SpecialTileLay)layTile.getSpecialProperty();
if (sp.requiresConnection()) {
  addConnectedTileLays(layTile);
}
 else {
  addLocatedTileLays(layTile);
}
break;
case (LayTile.LOCATION_SPECIFIC):
addLocatedTileLays(layTile);
break;
default :
}
}
}
Program: 173400
Project: 173400
Buggy source:
private void defineRevenueBonuses(){
  Set<MapHex> hexes=new HashSet<MapHex>();
  for (  NetworkVertex vertex : getVertices()) {
    MapHex hex=vertex.getHex();
    if (hex != null)     hexes.add(hex);
  }
  for (  MapHex hex : hexes) {
    List<RevenueBonusTemplate> bonuses=new ArrayList<RevenueBonusTemplate>();
    List<RevenueBonusTemplate> hexBonuses=hex.getRevenueBonuses();
    if (hexBonuses != null)     bonuses.addAll(hexBonuses);
    List<RevenueBonusTemplate> tileBonuses=hex.getCurrentTile().getRevenueBonuses();
    if (tileBonuses != null)     bonuses.addAll(tileBonuses);
    for (    RevenueBonusTemplate bonus : bonuses) {
      addRevenueBonus(bonus.toRevenueBonus(hex,root,graph));
    }
  }
  log.info("String_Node_Str" + revenueBonuses);
}

Fixed version (ground truth):
private void defineRevenueBonuses(){
  Set<MapHex> hexes=new HashSet<MapHex>();
  for (  NetworkVertex vertex : getVertices()) {
    MapHex hex=vertex.getHex();
    if (hex != null)     hexes.add(hex);
  }
  for (  MapHex hex : hexes) {
    List<RevenueBonusTemplate> bonuses=new ArrayList<RevenueBonusTemplate>();
    List<RevenueBonusTemplate> hexBonuses=hex.getRevenueBonuses();
    if (hexBonuses != null)     bonuses.addAll(hexBonuses);
    List<RevenueBonusTemplate> tileBonuses=hex.getCurrentTile().getRevenueBonuses();
    if (tileBonuses != null)     bonuses.addAll(tileBonuses);
    for (    RevenueBonusTemplate bonus : bonuses) {
      RevenueBonus bonusConverted=bonus.toRevenueBonus(hex,root,graph);
      if (bonusConverted != null) {
        addRevenueBonus(bonusConverted);
      }
    }
  }
  log.info("String_Node_Str" + revenueBonuses);
}
Program: 173401
Project: 173401
Buggy source:
public RevenueBonus toRevenueBonus(MapHex hex,RailsRoot root,NetworkGraph graph){
  log.info("String_Node_Str" + this);
  RevenueBonus bonus=new RevenueBonus(value,name);
  if (!convertVertices(bonus,graph,hex)) {
    log.info("String_Node_Str");
    return null;
  }
  convertTrainTypes(bonus,root.getTrainManager());
  convertPhases(bonus,root.getPhaseManager());
  log.info("String_Node_Str" + bonus);
  return bonus;
}

Fixed version (ground truth):
public RevenueBonus toRevenueBonus(MapHex hex,RailsRoot root,NetworkGraph graph){
  log.info("String_Node_Str" + this);
  RevenueBonus bonus=new RevenueBonus(value,name);
  if (!convertVertices(bonus,graph,hex)) {
    log.warn("String_Node_Str" + this.toString());
    return null;
  }
  convertTrainTypes(bonus,root.getTrainManager());
  convertPhases(bonus,root.getPhaseManager());
  log.info("String_Node_Str" + bonus);
  return bonus;
}
Program: 173402
Project: 173402
Buggy source:
/** 
 * Returns one train of any type held 
 */
public Set<Train> getUniqueTrains(){
  Set<Train> trainsFound=new HashSet<Train>();
  Map<TrainType,Object> trainTypesFound=new HashMap<TrainType,Object>();
  for (  Train train : trains.getPortfolio()) {
    if (!trainTypesFound.containsKey(train.getType())) {
      trainsFound.add(train);
      trainTypesFound.put(train.getType(),null);
    }
  }
  return trainsFound;
}

Fixed version (ground truth):
/** 
 * Returns one train of any type held 
 */
public Set<Train> getUniqueTrains(){
  ImmutableSortedSet.Builder<Train> trainsFound=ImmutableSortedSet.naturalOrder();
  Set<TrainType> trainTypesFound=Sets.newHashSet();
  for (  Train train : trains.getPortfolio()) {
    if (!trainTypesFound.contains(train.getType())) {
      trainsFound.add(train);
      trainTypesFound.add(train.getType());
    }
  }
  return trainsFound.build();
}
Program: 173403
Project: 173403
Buggy source:
@Override protected boolean equalsAs(PossibleAction pa,boolean asOption){
  if (pa == this)   return true;
  if (!super.equalsAs(pa,asOption))   return false;
  DiscardTrain action=(DiscardTrain)pa;
  boolean options=Objects.equal(this.ownedTrains,action.ownedTrains) && Objects.equal(this.forced,action.forced);
  if (asOption)   return options;
  return options && Objects.equal(this.discardedTrain,action.discardedTrain);
}

Fixed version (ground truth):
@Override protected boolean equalsAs(PossibleAction pa,boolean asOption){
  if (pa == this)   return true;
  if (!super.equalsAs(pa,asOption))   return false;
  DiscardTrain action=(DiscardTrain)pa;
  boolean options=Objects.equal(this.getOwnedTrainTypes(),action.getOwnedTrainTypes()) && Objects.equal(this.forced,action.forced);
  if (asOption)   return options;
  return options && Objects.equal(this.discardedTrain.getType(),action.discardedTrain.getType());
}
Program: 173404
Project: 173404
Buggy source:
private static String prepareTestGame(File gameFile,boolean overrideReport){
  if (!gameFile.exists() || !gameFile.isFile())   return null;
  String fileName=gameFile.getName();
  int dot=fileName.lastIndexOf(extensionSeparator);
  String gameName=null;
  if (dot != -1 && fileName.substring(dot + 1).equals(Config.get("String_Node_Str"))) {
    gameName=fileName.substring(0,dot);
    String gamePath=gameFile.getParent();
    String reportFilename=gamePath + File.separator + gameName+ "String_Node_Str"+ Config.get("String_Node_Str");
    File reportFile=new File(reportFilename);
    if (!reportFile.exists() || overrideReport)     prepareGameReport(gameFile,reportFilename);
  }
  return gameName;
}

Fixed version (ground truth):
private static String prepareTestGame(File gameFile,boolean overrideReport){
  if (!gameFile.exists() || !gameFile.isFile())   return null;
  String fileName=gameFile.getName();
  int dot=fileName.lastIndexOf(extensionSeparator);
  String gameName=null;
  if (dot != -1 && fileName.substring(dot + 1).equals(Config.get("String_Node_Str"))) {
    gameName=fileName.substring(0,dot);
    String gamePath=gameFile.getParent();
    String reportFilename=gamePath + File.separator + gameName+ "String_Node_Str"+ Config.get("String_Node_Str");
    File reportFile=new File(reportFilename);
    if (!reportFile.exists() || overrideReport) {
      prepareGameReport(gameFile,reportFilename);
      RailsRoot.clearInstance();
    }
  }
  return gameName;
}
Program: 173405
Project: 173405
Buggy source:
public void hyperlinkUpdate(HyperlinkEvent e){
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    activateTimeWarp();
    URL url=e.getURL();
    int index=url.getPort();
    gotoIndex(index + 1);
    toFront();
  }
}

Fixed version (ground truth):
public void hyperlinkUpdate(HyperlinkEvent e){
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    activateTimeWarp();
    URL url=e.getURL();
    int index=url.getPort();
    gotoIndex(index);
    toFront();
  }
}
Program: 173406
Project: 173406
Buggy source:
private boolean validate(){
  invalids.clear();
  allowed.addAll(stops);
  if (!(action instanceof LayBonusToken || hex.getHex().isHomeFor(action.getCompany()))) {
    if (hexBlocked()) {
      invalids.add(Invalids.HEX_BLOCKED);
    }
    if (hexReserved()) {
      invalids.add(Invalids.HEX_RESERVED);
    }
  }
  selectedStop=allowed.first();
  return invalids.isEmpty();
}

Fixed version (ground truth):
private boolean validate(){
  invalids.clear();
  allowed.addAll(stops);
  if (!(action instanceof LayBonusToken || hex.getHex().isHomeFor(action.getCompany()))) {
    if (hexBlocked()) {
      invalids.add(Invalids.HEX_BLOCKED);
    }
    if (hexReserved()) {
      invalids.add(Invalids.HEX_RESERVED);
    }
  }
  if (allowed.isEmpty() || !invalids.isEmpty()) {
    selectedStop=null;
    return false;
  }
 else {
    selectedStop=allowed.first();
    return true;
  }
}
Program: 173407
Project: 173407
Buggy source:
public void finishConfiguration(RailsRoot root,int sortingDigits) throws ConfigurationException {
  try {
    int externalNb=Integer.parseInt(externalId);
    NumberFormat nf=NumberFormat.getInstance();
    nf.setMinimumIntegerDigits(sortingDigits);
    sortingId=nf.format(externalNb);
  }
 catch (  NumberFormatException e) {
    sortingId=externalId;
  }
  for (  TileUpgrade upgrade : upgrades) {
    upgrade.finishConfiguration(root);
  }
}

Fixed version (ground truth):
public void finishConfiguration(RailsRoot root,int sortingDigits) throws ConfigurationException {
  prepainted=true;
  try {
    int externalNb=Integer.parseInt(externalId);
    NumberFormat nf=NumberFormat.getInstance();
    nf.setMinimumIntegerDigits(sortingDigits);
    sortingId=nf.format(externalNb);
    if (externalNb > 0) {
      prepainted=false;
    }
  }
 catch (  NumberFormatException e) {
    sortingId=externalId;
  }
  for (  TileUpgrade upgrade : upgrades) {
    upgrade.finishConfiguration(root);
  }
}
Program: 173408
Project: 173408
Buggy source:
public boolean isTilePainted(Tile tile){
  return !displayMapImage || (tile.getColour().getNumber() >= TileColour.YELLOW.getNumber());
}

Fixed version (ground truth):
public boolean isTilePainted(Tile tile){
  return !(displayMapImage && tile.isPrepainted());
}
Program: 173409
Project: 173409
Buggy source:
@Override public int compare(MapUpgrade u1,MapUpgrade u2){
  if (u1 instanceof TileHexUpgrade && u2 instanceof TileHexUpgrade) {
    Tile t1=((TileHexUpgrade)u1).getUpgrade().getTargetTile();
    Tile t2=((TileHexUpgrade)u2).getUpgrade().getTargetTile();
    return t1.compareTo(t2);
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(MapUpgrade u1,MapUpgrade u2){
  if (u1 instanceof TileHexUpgrade && u2 instanceof TileHexUpgrade) {
    TileHexUpgrade tu1=(TileHexUpgrade)u1;
    TileHexUpgrade tu2=(TileHexUpgrade)u2;
    return ComparisonChain.start().compare(tu1.getAction(),tu2.getAction()).compare(tu1.getUpgrade().getTargetTile(),tu2.getUpgrade().getTargetTile()).compare(tu1.getLocation().getId(),tu2.getLocation().getId()).result();
  }
  return 0;
}
Program: 173410
Project: 173410
Buggy source:
@Override public Comparator<MapUpgrade> getComparator(){
  return new Comparator<MapUpgrade>(){
    @Override public int compare(    MapUpgrade u1,    MapUpgrade u2){
      if (u1 instanceof TileHexUpgrade && u2 instanceof TileHexUpgrade) {
        Tile t1=((TileHexUpgrade)u1).getUpgrade().getTargetTile();
        Tile t2=((TileHexUpgrade)u2).getUpgrade().getTargetTile();
        return t1.compareTo(t2);
      }
      return 0;
    }
  }
;
}

Fixed version (ground truth):
@Override public Comparator<MapUpgrade> getComparator(){
  return new Comparator<MapUpgrade>(){
    @Override public int compare(    MapUpgrade u1,    MapUpgrade u2){
      if (u1 instanceof TileHexUpgrade && u2 instanceof TileHexUpgrade) {
        TileHexUpgrade tu1=(TileHexUpgrade)u1;
        TileHexUpgrade tu2=(TileHexUpgrade)u2;
        return ComparisonChain.start().compare(tu1.getAction(),tu2.getAction()).compare(tu1.getUpgrade().getTargetTile(),tu2.getUpgrade().getTargetTile()).compare(tu1.getLocation().getId(),tu2.getLocation().getId()).result();
      }
      return 0;
    }
  }
;
}
Program: 173411
Project: 173411
Buggy source:
private String labelText(Tile tile,boolean vertical){
  StringBuffer text=new StringBuffer();
  text.append("String_Node_Str" + tile.toText());
  if (!tile.isUnlimited()) {
    if (vertical) {
      text.append("String_Node_Str");
    }
 else {
      text.append("String_Node_Str");
    }
    text.append("String_Node_Str" + tile.getFreeCount() + "String_Node_Str");
  }
  text.append("String_Node_Str");
  return text.toString();
}

Fixed version (ground truth):
private String labelText(TileHexUpgrade upgrade,boolean vertical){
  Tile tile=upgrade.getUpgrade().getTargetTile();
  StringBuilder text=new StringBuilder();
  text.append("String_Node_Str" + tile.toText());
  if (!tile.isUnlimited()) {
    if (vertical) {
      text.append("String_Node_Str");
    }
 else {
      text.append("String_Node_Str");
    }
    text.append("String_Node_Str" + tile.getFreeCount() + "String_Node_Str");
  }
  LayTile action=upgrade.getAction();
  if (action.getSpecialProperty() != null) {
    text.append("String_Node_Str" + action.getSpecialProperty().getOriginalCompany().getId() + "String_Node_Str");
  }
  text.append("String_Node_Str");
  return text.toString();
}
Program: 173412
Project: 173412
Buggy source:
private UpgradeLabel(ImageIcon hexIcon,TileHexUpgrade upgrade,String toolTipHeaderLine,String toolTipBody){
  super(hexIcon);
  this.upgrade=upgrade;
  Tile tile=upgrade.getUpgrade().getTargetTile();
  this.setText(labelText(tile,true));
  this.setToolTipText(toolTipText(tile,toolTipHeaderLine,toolTipBody));
  this.setOpaque(true);
  this.setVisible(true);
  this.setBorder(BORDER);
}

Fixed version (ground truth):
private UpgradeLabel(ImageIcon hexIcon,TileHexUpgrade upgrade,String toolTipHeaderLine,String toolTipBody){
  super(hexIcon);
  this.upgrade=upgrade;
  Tile tile=upgrade.getUpgrade().getTargetTile();
  this.setText(labelText(upgrade,true));
  this.setToolTipText(toolTipText(tile,toolTipHeaderLine,toolTipBody));
  this.setOpaque(true);
  this.setVisible(true);
  this.setBorder(BORDER);
}
Program: 173413
Project: 173413
Buggy source:
public void selectHex(GUIHex clickedHex){
  log.debug("String_Node_Str" + (clickedHex != null ? clickedHex.toText() : "String_Node_Str") + "String_Node_Str"+ (selectedHex != null ? selectedHex.toText() : "String_Node_Str"));
  if (selectedHex == clickedHex)   return;
  if (selectedHex != null) {
    selectedHex.setState(GUIHex.State.SELECTED);
  }
  if (clickedHex != null) {
    clickedHex.setState(GUIHex.State.SELECTED);
  }
  selectedHex=clickedHex;
}

Fixed version (ground truth):
public void selectHex(GUIHex clickedHex){
  log.debug("String_Node_Str" + (clickedHex != null ? clickedHex.toText() : "String_Node_Str") + "String_Node_Str"+ (selectedHex != null ? selectedHex.toText() : "String_Node_Str"));
  if (selectedHex == clickedHex)   return;
  if (selectedHex != null) {
    selectedHex.setState(GUIHex.State.SELECTABLE);
  }
  if (clickedHex != null) {
    clickedHex.setState(GUIHex.State.SELECTED);
  }
  selectedHex=clickedHex;
}
Program: 173414
Project: 173414
Buggy source:
public void startPrussianFormationRound(OperatingRound_1835 or){
  interruptedRound=or;
  String roundName;
  if (interruptedRound == null) {
    roundName="String_Node_Str" + previousRound.getId();
  }
 else {
    roundName="String_Node_Str" + or.getId();
  }
  createRound(PrussianFormationRound.class,roundName).start();
}

Fixed version (ground truth):
public void startPrussianFormationRound(OperatingRound_1835 or){
  interruptedRound=or;
  String roundName;
  if (interruptedRound == null) {
    roundName="String_Node_Str" + previousRound.getId();
  }
 else {
    roundName="String_Node_Str" + or.getId() + "String_Node_Str"+ getCurrentPhase().getId();
  }
  createRound(PrussianFormationRound.class,roundName).start();
}
Program: 173415
Project: 173415
Buggy source:
protected void disableButtons(){
  bidButton.setEnabled(false);
  buyButton.setEnabled(false);
  passButton.setEnabled(false);
}

Fixed version (ground truth):
protected void disableButtons(){
  if (includeBidding) {
    bidButton.setEnabled(false);
  }
  buyButton.setEnabled(false);
  passButton.setEnabled(false);
}
Program: 173416
Project: 173416
Buggy source:
private boolean trainTypeCanAffectOR(TrainType type){
  if ((type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str"))) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean trainTypeCanAffectOR(TrainType type){
  if ((type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str") == false)) {
    return true;
  }
  return false;
}
Program: 173417
Project: 173417
Buggy source:
private boolean trainTypeCanAffectOR(TrainType type){
  if ((type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str"))) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean trainTypeCanAffectOR(TrainType type){
  if ((type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str") == false) && (type.getName().equals("String_Node_Str") == false)) {
    return true;
  }
  return false;
}
Program: 173420
Project: 173420
Buggy source:
/** 
 * Split a dividend. TODO Optional rounding down the payout
 * @param amount
 */
public void splitRevenue(int amount){
  if (amount > 0) {
    int numberOfShares=operatingCompany.value().getNumberOfShares();
    int withheld=(amount / (2 * numberOfShares)) * numberOfShares;
    String withheldText=Currency.fromBank(withheld,operatingCompany.value());
    ReportBuffer.add(this,operatingCompany.value().getId() + LocalText.getText("String_Node_Str") + withheldText);
    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.value().getNumberOfShares();
    int withheld=(amount / (2 * numberOfShares)) * numberOfShares;
    String withheldText=Currency.fromBank(withheld,operatingCompany.value());
    ReportBuffer.add(this,operatingCompany.value().getId() + "String_Node_Str" + LocalText.getText("String_Node_Str")+ "String_Node_Str"+ withheldText);
    int payed=amount - withheld;
    payout(payed);
  }
}
Program: 173421
Project: 173421
Buggy source:
private void addLocatedTileLays(LayTile layTile){
  for (  MapHex hex : layTile.getLocations()) {
    GUIHex guiHex=map.getHex(hex);
    Set<TileHexUpgrade> upgrades=TileHexUpgrade.createLocated(hex,layTile);
    tileUpgrades.putAll(guiHex,upgrades);
  }
}

Fixed version (ground truth):
private void addLocatedTileLays(LayTile layTile){
  for (  MapHex hex : layTile.getLocations()) {
    GUIHex guiHex=map.getHex(hex);
    Set<TileHexUpgrade> upgrades=TileHexUpgrade.createLocated(hex,layTile);
    TileHexUpgrade.validateAndEnable(upgrades,gameUIManager.getCurrentPhase());
    tileUpgrades.putAll(guiHex,upgrades);
  }
}
Program: 173423
Project: 173423
Buggy source:
@Override public boolean process(PossibleAction action){
  if (!super.process(action))   return false;
  StartItem item;
  while ((item=startPacket.getFirstUnsoldItem()) != null && item.getBidders() == 1 && item.needsPriceSetting() == null) {
    assignItem(item.getBidder(),item,item.getBid(),0);
    if (startPacket.areAllSold()) {
      finishRound();
      break;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean process(PossibleAction action){
  if (!super.process(action))   return false;
  return true;
}
Program: 173425
Project: 173425
Buggy source:
@Override protected boolean buy(String playerName,BuyStartItem boughtItem){
  boolean result=super.buy(playerName,boughtItem);
  auctionItemState.set(null);
  return result;
}

Fixed version (ground truth):
@Override protected boolean buy(String playerName,BuyStartItem boughtItem){
  StartItem item=boughtItem.getStartItem();
  int lastBid=item.getBid();
  String errMsg=null;
  Player player=playerManager.getCurrentPlayer();
  int price=0;
  int sharePrice=0;
  String shareCompName="String_Node_Str";
  while (true) {
    if (!boughtItem.setSharePriceOnly()) {
      if (item.getStatus() != StartItem.BUYABLE) {
        errMsg=LocalText.getText("String_Node_Str");
        break;
      }
      price=item.getBasePrice();
      if (item.getBid() > price)       price=item.getBid();
      if (player.getFreeCash() < price) {
        errMsg=LocalText.getText("String_Node_Str");
        break;
      }
    }
 else {
      price=item.getBid();
    }
    if (boughtItem.hasSharePriceToSet()) {
      shareCompName=boughtItem.getCompanyToSetPriceFor();
      sharePrice=boughtItem.getAssociatedSharePrice();
      if (sharePrice == 0) {
        errMsg=LocalText.getText("String_Node_Str",shareCompName);
        break;
      }
    }
    break;
  }
  if (errMsg != null) {
    System.out.println(errMsg);
    DisplayBuffer.add(this,LocalText.getText("String_Node_Str",playerName,item.getName(),errMsg));
    return false;
  }
  assignItem(player,item,price,sharePrice);
  if (lastBid == 0) {
    playerManager.setPriorityPlayerToNext();
  }
  playerManager.setCurrentToNextPlayer();
  numPasses.set(0);
  auctionItemState.set(null);
  return true;
}
Program: 173426
Project: 173426
Buggy source:
@Override public boolean equalsAsOption(PossibleAction pa){
  if (pa == this)   return true;
  if (!super.equalsAsOption(pa))   return false;
  BuyCertificate action=(BuyCertificate)pa;
  return Objects.equal(this.certificate,action.certificate) && Objects.equal(this.company,action.company) && Objects.equal(this.from,action.from)&& Objects.equal(this.maximumNumber,action.maximumNumber);
}

Fixed version (ground truth):
@Override public boolean equalsAsOption(PossibleAction pa){
  if (pa == this)   return true;
  if (!super.equalsAsOption(pa))   return false;
  BuyCertificate action=(BuyCertificate)pa;
  return Objects.equal(this.company,action.company) && Objects.equal(this.from,action.from) && Objects.equal(this.maximumNumber,action.maximumNumber);
}
Program: 173427
Project: 173427
Buggy source:
/** 
 * Compare is based on  A) Presidency (presidency comes first in natural ordering) B) Number of Shares (more shares means come first) C) Id of CertificateType D) Id of Certificate
 */
@Override public int compareTo(Ownable other){
  if (other instanceof PublicCertificate) {
    PublicCertificate otherCert=(PublicCertificate)other;
    return ComparisonChain.start().compare(this.getId(),otherCert.getId()).result();
  }
 else {
    return super.compareTo(other);
  }
}

Fixed version (ground truth):
/** 
 * Compare is based on  A) Presidency (presidency comes first in natural ordering) B) Number of Shares (more shares means come first) C) Id of CertificateType D) Id of Certificate
 */
@Override public int compareTo(Ownable other){
  if (other instanceof PublicCertificate) {
    PublicCertificate otherCert=(PublicCertificate)other;
    return ComparisonChain.start().compare(this.getCompany(),otherCert.getCompany()).compare(this.getId(),otherCert.getId()).result();
  }
 else {
    return super.compareTo(other);
  }
}
Program: 173428
Project: 173428
Buggy source:
private void checkPlayerOrder(){
  if (gameManager.getStartRoundNumber() == 1) {
    turn.add(1);
    int cycleNumber=(turn.value() + 1) / playerManager.getNumberOfPlayers() + 1;
    if (variant.equalsIgnoreCase(CLEMENS_VARIANT)) {
      if (cycleNumber == 1) {
        playerManager.reversePlayerOrder(false);
      }
    }
 else     if (variant.equalsIgnoreCase(SNAKE_VARIANT)) {
      if (cycleNumber == 2) {
        playerManager.reversePlayerOrder(true);
      }
 else       if (cycleNumber == 3) {
        playerManager.reversePlayerOrder(false);
      }
    }
  }
}

Fixed version (ground truth):
private void checkPlayerOrder(){
  if (gameManager.getStartRoundNumber() == 1) {
    turn.add(1);
    int cycleNumber=(turn.value()) / playerManager.getNumberOfPlayers();
    int playerNumber=(turn.value()) % playerManager.getNumberOfPlayers();
    log.debug("String_Node_Str" + turn.value() + "String_Node_Str"+ cycleNumber+ "String_Node_Str"+ playerNumber);
    if (variant.equalsIgnoreCase(CLEMENS_VARIANT)) {
      if (cycleNumber == 1 && playerNumber == 0) {
        playerManager.reversePlayerOrder(false);
        playerManager.setCurrentToNextPlayer();
      }
    }
 else     if (variant.equalsIgnoreCase(SNAKE_VARIANT)) {
      if (cycleNumber == 2) {
        playerManager.reversePlayerOrder(true);
      }
 else       if (cycleNumber == 3) {
        playerManager.reversePlayerOrder(false);
      }
    }
  }
}
Program: 173429
Project: 173429
Buggy source:
@Override public void start(){
  super.start();
  if (variant.equalsIgnoreCase(CLEMENS_VARIANT)) {
    playerManager.reversePlayerOrder(true);
  }
  if (!setPossibleActions()) {
    finishRound();
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (variant.equalsIgnoreCase(CLEMENS_VARIANT)) {
    playerManager.reversePlayerOrder(true);
    Player lastPlayer=playerManager.getNextPlayerAfter(playerManager.getPriorityPlayer());
    playerManager.setPriorityPlayer(lastPlayer);
  }
  super.start();
  if (!setPossibleActions()) {
    finishRound();
  }
}
Program: 173430
Project: 173430
Buggy source:
/** 
 * @param key that defines the specific for which the portfolio members get returned
 * @return all items for the key contained in the portfolio
 */
public ImmutableSortedSet<T> items(K key){
  return portfolio.values();
}

Fixed version (ground truth):
/** 
 * @param key that defines the specific for which the portfolio members get returned
 * @return all items for the key contained in the portfolio
 */
public ImmutableSortedSet<T> items(K key){
  return portfolio.get(key);
}
Program: 173431
Project: 173431
Buggy source:
@Override public String toString(){
  return super.toString() + RailsObjects.stringHelper(this).addToString("String_Node_Str",certificate).addToString("String_Node_Str",company).addToString("String_Node_Str",sharePerCert).addToString("String_Node_Str",from).addToString("String_Node_Str",price).addToString("String_Node_Str",maximumNumber).addToStringOnlyActed("String_Node_Str",numberBought).toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return super.toString() + RailsObjects.stringHelper(this).addToString("String_Node_Str",certificate).addToString("String_Node_Str",company).addToString("String_Node_Str",sharePerCert).addToString("String_Node_Str",fromName).addToString("String_Node_Str",from).addToString("String_Node_Str",price).addToString("String_Node_Str",maximumNumber).addToStringOnlyActed("String_Node_Str",numberBought).toString();
}
Program: 173434
Project: 173434
Buggy source:
public void addImpassableSide(HexSide side){
  impassableBuilder.set(side);
}

Fixed version (ground truth):
public void addImpassableSide(HexSide side){
  impassableBuilder.set(side);
  log.debug("String_Node_Str" + side + "String_Node_Str"+ this);
}
Program: 173436
Project: 173436
Buggy source:
/** 
 * Compare is based on  A) Presidency (presidency comes first in natural ordering) B) Number of Shares (more shares means come first) C) Id of CertificateType D) Id of Certificate
 */
@Override public int compareTo(Ownable other){
  if (other instanceof PublicCertificate) {
    PublicCertificate otherCert=(PublicCertificate)other;
    return ComparisonChain.start().compare(this.getId(),otherCert.getId()).result();
  }
 else {
    return super.compareTo(other);
  }
}

Fixed version (ground truth):
/** 
 * Compare is based on  A) Presidency (presidency comes first in natural ordering) B) Number of Shares (more shares means come first) C) Id of CertificateType D) Id of Certificate
 */
@Override public int compareTo(Ownable other){
  if (other instanceof PublicCertificate) {
    PublicCertificate otherCert=(PublicCertificate)other;
    return ComparisonChain.start().compare(this.getCompany(),otherCert.getCompany()).compare(this.getId(),otherCert.getId()).result();
  }
 else {
    return super.compareTo(other);
  }
}
Program: 173437
Project: 173437
Buggy source:
private void checkPlayerOrder(){
  if (gameManager.getStartRoundNumber() == 1) {
    turn.add(1);
    int cycleNumber=(turn.value() + 1) / playerManager.getNumberOfPlayers() + 1;
    if (variant.equalsIgnoreCase(CLEMENS_VARIANT)) {
      if (cycleNumber == 1) {
        playerManager.reversePlayerOrder(false);
      }
    }
 else     if (variant.equalsIgnoreCase(SNAKE_VARIANT)) {
      if (cycleNumber == 2) {
        playerManager.reversePlayerOrder(true);
      }
 else       if (cycleNumber == 3) {
        playerManager.reversePlayerOrder(false);
      }
    }
  }
}

Fixed version (ground truth):
private void checkPlayerOrder(){
  if (gameManager.getStartRoundNumber() == 1) {
    turn.add(1);
    int cycleNumber=(turn.value()) / playerManager.getNumberOfPlayers();
    int playerNumber=(turn.value()) % playerManager.getNumberOfPlayers();
    log.debug("String_Node_Str" + turn.value() + "String_Node_Str"+ cycleNumber+ "String_Node_Str"+ playerNumber);
    if (variant.equalsIgnoreCase(CLEMENS_VARIANT)) {
      if (cycleNumber == 1 && playerNumber == 0) {
        playerManager.reversePlayerOrder(false);
        playerManager.setCurrentToNextPlayer();
      }
    }
 else     if (variant.equalsIgnoreCase(SNAKE_VARIANT)) {
      if (cycleNumber == 2) {
        playerManager.reversePlayerOrder(true);
      }
 else       if (cycleNumber == 3) {
        playerManager.reversePlayerOrder(false);
      }
    }
  }
}