nus-yam/ex-repair huggingface dataset:
Program: 173318
Project: 173318
Buggy source:
private void initRouteGraph(NetworkGraph mapGraph,PublicCompany company,boolean addHQ){
  RevenueManager revenueManager=company.getRoot().getRevenueManager();
  if (revenueManager != null) {
    revenueManager.activateRouteGraphModifiers(mapGraph,company);
  }
  NetworkVertex.initAllRailsVertices(mapGraph,company,null);
  NetworkVertex hqVertex=new NetworkVertex(company);
  graph.addVertex(hqVertex);
  List<NetworkVertex> tokenVertexes=mapGraph.getCompanyBaseTokenVertexes(company);
  Set<NetworkVertex> vertexes=new HashSet<NetworkVertex>();
  for (  NetworkVertex vertex : tokenVertexes) {
    boolean storeSink=vertex.isSink();
    vertex.setSink(false);
    vertexes.add(vertex);
    graph.addVertex(vertex);
    graph.addEdge(vertex,hqVertex,new NetworkEdge(vertex,hqVertex,false));
    iterator=new NetworkIterator(mapGraph.getGraph(),vertex,company);
    for (; iterator.hasNext(); ) {
      NetworkVertex seenVertex=iterator.next();
      if (iterator.getSeenData().get(seenVertex) != NetworkIterator.greedyState.greedy) {
        vertexes.add(seenVertex);
      }
    }
    vertex.setSink(storeSink);
  }
  Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>> subGraph=new Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>>(mapGraph.getGraph(),vertexes);
  Graphs.addGraph(graph,subGraph);
  if (!addHQ)   graph.removeVertex(hqVertex);
}

Fixed version (ground truth):
private void initRouteGraph(NetworkGraph mapGraph,PublicCompany company,boolean addHQ){
  RevenueManager revenueManager=company.getRoot().getRevenueManager();
  if (revenueManager != null) {
    revenueManager.activateRouteGraphModifiers(mapGraph,company);
  }
  NetworkVertex.initAllRailsVertices(mapGraph,company,null);
  NetworkVertex hqVertex=new NetworkVertex(company);
  graph.addVertex(hqVertex);
  List<NetworkVertex> tokenVertexes=mapGraph.getCompanyBaseTokenVertexes(company);
  Set<NetworkVertex> vertexes=new HashSet<NetworkVertex>();
  for (  NetworkVertex vertex : tokenVertexes) {
    boolean storeSink=vertex.isSink();
    vertex.setSink(false);
    vertexes.add(vertex);
    graph.addVertex(vertex);
    graph.addEdge(vertex,hqVertex,new NetworkEdge(vertex,hqVertex,false));
    iterator=new NetworkIterator(mapGraph.getGraph(),vertex,company);
    for (; iterator.hasNext(); )     vertexes.add(iterator.next());
    vertex.setSink(storeSink);
  }
  Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>> subGraph=new Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>>(mapGraph.getGraph(),vertexes);
  Graphs.addGraph(graph,subGraph);
  if (!addHQ)   graph.removeVertex(hqVertex);
}
Program: 173319
Project: 173319
Buggy source:
public ImmutableMap<MapHex,HexSidesSet> getReachableSides(){
  Map<MapHex,HexSidesSet.Builder> hexSides=Maps.newHashMap();
  for (  NetworkVertex vertex : graph.vertexSet()) {
    if (vertex.isSide() && iterator.getSeenData().get(vertex) != NetworkIterator.greedyState.greedy) {
      MapHex hex=vertex.getHex();
      if (!hexSides.containsKey(hex)) {
        hexSides.put(hex,HexSidesSet.builder());
      }
      hexSides.get(hex).set(vertex.getSide());
    }
  }
  ImmutableMap.Builder<MapHex,HexSidesSet> hexBuilder=ImmutableMap.builder();
  for (  MapHex hex : hexSides.keySet()) {
    hexBuilder.put(hex,hexSides.get(hex).build());
  }
  return hexBuilder.build();
}

Fixed version (ground truth):
public ImmutableMap<MapHex,HexSidesSet> getReachableSides(){
  Map<MapHex,HexSidesSet.Builder> hexSides=Maps.newHashMap();
  for (  NetworkVertex vertex : graph.vertexSet()) {
    if (vertex.isSide()) {
      MapHex hex=vertex.getHex();
      if (!hexSides.containsKey(hex)) {
        hexSides.put(hex,HexSidesSet.builder());
      }
      hexSides.get(hex).set(vertex.getSide());
    }
  }
  ImmutableMap.Builder<MapHex,HexSidesSet> hexBuilder=ImmutableMap.builder();
  for (  MapHex hex : hexSides.keySet()) {
    hexBuilder.put(hex,hexSides.get(hex).build());
  }
  return hexBuilder.build();
}
Program: 173320
Project: 173320
Buggy source:
private void initRouteGraph(NetworkGraph mapGraph,PublicCompany company,boolean addHQ){
  RevenueManager revenueManager=company.getRoot().getRevenueManager();
  if (revenueManager != null) {
    revenueManager.activateRouteGraphModifiers(mapGraph,company);
  }
  NetworkVertex.initAllRailsVertices(mapGraph,company,null);
  NetworkVertex hqVertex=new NetworkVertex(company);
  graph.addVertex(hqVertex);
  List<NetworkVertex> tokenVertexes=mapGraph.getCompanyBaseTokenVertexes(company);
  Set<NetworkVertex> vertexes=new HashSet<NetworkVertex>();
  for (  NetworkVertex vertex : tokenVertexes) {
    boolean storeSink=vertex.isSink();
    vertex.setSink(false);
    vertexes.add(vertex);
    graph.addVertex(vertex);
    graph.addEdge(vertex,hqVertex,new NetworkEdge(vertex,hqVertex,false));
    iterator=new NetworkIterator(mapGraph.getGraph(),vertex,company);
    for (; iterator.hasNext(); )     vertexes.add(iterator.next());
    vertex.setSink(storeSink);
  }
  Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>> subGraph=new Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>>(mapGraph.getGraph(),vertexes);
  Graphs.addGraph(graph,subGraph);
  if (!addHQ)   graph.removeVertex(hqVertex);
}

Fixed version (ground truth):
private void initRouteGraph(NetworkGraph mapGraph,PublicCompany company,boolean addHQ){
  RevenueManager revenueManager=company.getRoot().getRevenueManager();
  if (revenueManager != null) {
    revenueManager.activateRouteGraphModifiers(mapGraph,company);
  }
  NetworkVertex.initAllRailsVertices(mapGraph,company,null);
  NetworkVertex hqVertex=new NetworkVertex(company);
  graph.addVertex(hqVertex);
  List<NetworkVertex> tokenVertexes=mapGraph.getCompanyBaseTokenVertexes(company);
  Set<NetworkVertex> vertexes=new HashSet<NetworkVertex>();
  for (  NetworkVertex vertex : tokenVertexes) {
    boolean storeSink=vertex.isSink();
    vertex.setSink(false);
    vertexes.add(vertex);
    graph.addVertex(vertex);
    graph.addEdge(vertex,hqVertex,new NetworkEdge(vertex,hqVertex,false));
    iterator=new NetworkIterator(mapGraph.getGraph(),vertex,company);
    for (; iterator.hasNext(); ) {
      NetworkVertex seenVertex=iterator.next();
      if (iterator.getSeenData().get(seenVertex) != NetworkIterator.greedyState.greedy) {
        vertexes.add(seenVertex);
      }
    }
    vertex.setSink(storeSink);
  }
  Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>> subGraph=new Subgraph<NetworkVertex,NetworkEdge,SimpleGraph<NetworkVertex,NetworkEdge>>(mapGraph.getGraph(),vertexes);
  Graphs.addGraph(graph,subGraph);
  if (!addHQ)   graph.removeVertex(hqVertex);
}
Program: 173323
Project: 173323
Buggy source:
protected void deRegisterObservers(){
  log.debug("String_Node_Str");
  for (  Observer o : observers) {
    o.getObservable().removeObserver(o);
  }
}

Fixed version (ground truth):
protected void deRegisterObservers(){
  log.debug("String_Node_Str");
  for (  Observer o : observers) {
    Observable observable=o.getObservable();
    if (observable != null) {
      observable.removeObserver(o);
    }
  }
}
Program: 173324
Project: 173324
Buggy source:
public boolean specialBuyTrain(BuyTrain action){
  OrStep currentStep=getStep();
  setStep(GameDef.OrStep.BUY_TRAIN);
  boolean trainResults=super.buyTrain(action);
  setStep(currentStep);
  if (trainResults == false) {
    return false;
  }
  if ((ipo.getTrainsPerType(action.getType()).length == 0) && (trainTypeCanAffectOR(action.getType()) == true)) {
    orControl.orExitToStockRound(operatingCompany.value(),currentStep);
    setActionForPrivateExchange(action.getType());
    if (manditoryNextAction == null) {
      finishOR();
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean specialBuyTrain(BuyTrain action){
  OrStep currentStep=getStep();
  setStep(GameDef.OrStep.BUY_TRAIN);
  boolean trainResults=super.buyTrain(action);
  setStep(currentStep);
  if (!excessTrainCompanies.isEmpty()) {
    for (    Player CompanyOwner : excessTrainCompanies.keySet()) {
      List<PublicCompany> excessTrainCompaniesList=excessTrainCompanies.get(CompanyOwner);
      for (      PublicCompany excessTrainCompany : excessTrainCompaniesList) {
        int numberofTrainsToDiscard=(excessTrainCompany.getNumberOfTrains() - excessTrainCompany.getCurrentTrainLimit());
        Set<Train> trains=excessTrainCompany.getPortfolioModel().getTrainList();
        List<Train> trainsToDiscard=new ArrayList<Train>(4);
        for (        Train train : trains) {
          trainsToDiscard.add(train);
          if (--numberofTrainsToDiscard == 0)           break;
        }
        for (        Train train : trainsToDiscard) {
          train.discard();
          ReportBuffer.add(this,LocalText.getText("String_Node_Str",excessTrainCompany.getLongName(),train.getId()));
        }
      }
    }
  }
  if (trainResults == false) {
    return false;
  }
  if ((ipo.getTrainsPerType(action.getType()).length == 0) && (trainTypeCanAffectOR(action.getType()) == true)) {
    orControl.orExitToStockRound(operatingCompany.value(),currentStep);
    setActionForPrivateExchange(action.getType());
    if (manditoryNextAction == null) {
      finishOR();
    }
  }
  return true;
}
Program: 173325
Project: 173325
Buggy source:
public boolean specialBuyTrain(BuyTrain action){
  OrStep currentStep=getStep();
  setStep(GameDef.OrStep.BUY_TRAIN);
  boolean trainResults=super.buyTrain(action);
  setStep(currentStep);
  if (trainResults == false) {
    return false;
  }
  if ((ipo.getTrainsPerType(action.getType()).length == 0) && (trainTypeCanAffectOR(action.getType()) == true)) {
    orControl.orExitToStockRound(operatingCompany.value(),currentStep);
    setActionForPrivateExchange(action.getType());
    if (manditoryNextAction == null) {
      finishOR();
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean specialBuyTrain(BuyTrain action){
  OrStep currentStep=getStep();
  setStep(GameDef.OrStep.BUY_TRAIN);
  boolean trainResults=super.buyTrain(action);
  setStep(currentStep);
  if (!excessTrainCompanies.isEmpty()) {
    for (    Player CompanyOwner : excessTrainCompanies.keySet()) {
      List<PublicCompany> excessTrainCompaniesList=excessTrainCompanies.get(CompanyOwner);
      for (      PublicCompany excessTrainCompany : excessTrainCompaniesList) {
        int numberofTrainsToDiscard=(excessTrainCompany.getNumberOfTrains() - excessTrainCompany.getCurrentTrainLimit());
        Set<Train> trains=excessTrainCompany.getPortfolioModel().getTrainList();
        List<Train> trainsToDiscard=new ArrayList<Train>(4);
        for (        Train train : trains) {
          trainsToDiscard.add(train);
          if (--numberofTrainsToDiscard == 0)           break;
        }
        for (        Train train : trainsToDiscard) {
          train.discard();
          ReportBuffer.add(this,LocalText.getText("String_Node_Str",excessTrainCompany.getLongName(),train.getId()));
        }
      }
    }
  }
  if (trainResults == false) {
    return false;
  }
  if ((ipo.getTrainsPerType(action.getType()).length == 0) && (trainTypeCanAffectOR(action.getType()) == true)) {
    orControl.orExitToStockRound(operatingCompany.value(),currentStep);
    setActionForPrivateExchange(action.getType());
    if (manditoryNextAction == null) {
      finishOR();
    }
  }
  return true;
}
Program: 173326
Project: 173326
Buggy source:
@Override public void resume(){
  guiHints.setActivePanel(GuiDef.Panel.MAP);
  guiHints.setCurrentRoundType(getClass());
  if (savedAction instanceof BuyTrain) {
    BuyTrain action=(BuyTrain)savedAction;
    Player player=playerManager.getPlayerByName(action.getPlayerName());
    PublicCompany company=action.getCompany();
    int initialPlayerCash=player.getCash();
    int trainCost=action.getFixedCost();
    int amountOwed=(trainCost - company.getCash());
    Currency.wire(player,amountOwed,company);
    BuyTrain newTrainBuy=new BuyTrain(action.getTrain(),action.getFromOwner(),trainCost);
    newTrainBuy.setPricePaid(trainCost);
    buyTrain(newTrainBuy);
    int additionalDebt=-player.getCash();
    if (initialPlayerCash < 0) {
      additionalDebt=additionalDebt - (-initialPlayerCash);
    }
    int penalty=(additionalDebt / 2);
    ReportBuffer.add(this,LocalText.getText("String_Node_Str",player.getId(),Bank.format(this,penalty)));
    Currency.wire(player,penalty,getRoot().getBank());
  }
  wasInterrupted.set(true);
}

Fixed version (ground truth):
@Override public void resume(){
  guiHints.setActivePanel(GuiDef.Panel.MAP);
  guiHints.setCurrentRoundType(getClass());
  if (savedAction instanceof BuyTrain) {
    BuyTrain action=(BuyTrain)savedAction;
    Player player=playerManager.getPlayerByName(action.getPlayerName());
    PublicCompany company=action.getCompany();
    int initialPlayerCash=player.getCash();
    int trainCost=action.getFixedCost();
    int amountOwed=(trainCost - company.getCash());
    Currency.wire(player,amountOwed,company);
    BuyTrain newTrainBuy=new BuyTrain(action.getTrain(),action.getFromOwner(),trainCost);
    newTrainBuy.setPricePaid(trainCost);
    buyTrain(newTrainBuy);
    if (!(initialPlayerCash > amountOwed)) {
      int additionalDebt=-player.getCash();
      if (initialPlayerCash < 0) {
        additionalDebt=additionalDebt - (-initialPlayerCash);
      }
      int penalty=(additionalDebt / 2);
      ReportBuffer.add(this,LocalText.getText("String_Node_Str",player.getId(),Bank.format(this,penalty)));
      Currency.wire(player,penalty,getRoot().getBank());
    }
  }
  wasInterrupted.set(true);
}
Program: 173327
Project: 173327
Buggy source:
@Override public void resume(){
  guiHints.setActivePanel(GuiDef.Panel.MAP);
  guiHints.setCurrentRoundType(getClass());
  if (savedAction instanceof BuyTrain) {
    BuyTrain action=(BuyTrain)savedAction;
    Player player=playerManager.getPlayerByName(action.getPlayerName());
    PublicCompany company=action.getCompany();
    int initialPlayerCash=player.getCash();
    int trainCost=action.getFixedCost();
    int amountOwed=(trainCost - company.getCash());
    Currency.wire(player,amountOwed,company);
    BuyTrain newTrainBuy=new BuyTrain(action.getTrain(),action.getFromOwner(),trainCost);
    newTrainBuy.setPricePaid(trainCost);
    buyTrain(newTrainBuy);
    int additionalDebt=-player.getCash();
    if (initialPlayerCash < 0) {
      additionalDebt=additionalDebt - (-initialPlayerCash);
    }
    int penalty=(additionalDebt / 2);
    ReportBuffer.add(this,LocalText.getText("String_Node_Str",player.getId(),Bank.format(this,penalty)));
    Currency.wire(player,penalty,getRoot().getBank());
  }
  wasInterrupted.set(true);
}

Fixed version (ground truth):
@Override public void resume(){
  guiHints.setActivePanel(GuiDef.Panel.MAP);
  guiHints.setCurrentRoundType(getClass());
  if (savedAction instanceof BuyTrain) {
    BuyTrain action=(BuyTrain)savedAction;
    Player player=playerManager.getPlayerByName(action.getPlayerName());
    PublicCompany company=action.getCompany();
    int initialPlayerCash=player.getCash();
    int trainCost=action.getFixedCost();
    int amountOwed=(trainCost - company.getCash());
    Currency.wire(player,amountOwed,company);
    BuyTrain newTrainBuy=new BuyTrain(action.getTrain(),action.getFromOwner(),trainCost);
    newTrainBuy.setPricePaid(trainCost);
    buyTrain(newTrainBuy);
    if (!(initialPlayerCash > amountOwed)) {
      int additionalDebt=-player.getCash();
      if (initialPlayerCash < 0) {
        additionalDebt=additionalDebt - (-initialPlayerCash);
      }
      int penalty=(additionalDebt / 2);
      ReportBuffer.add(this,LocalText.getText("String_Node_Str",player.getId(),Bank.format(this,penalty)));
      Currency.wire(player,penalty,getRoot().getBank());
    }
  }
  wasInterrupted.set(true);
}
Program: 173328
Project: 173328
Buggy source:
public boolean isTileColourAllowed(String tileColour){
  return tileColours.contains(tileColour);
}

Fixed version (ground truth):
@Deprecated public boolean isTileColourAllowed(String tileColour){
  return tileColours.contains(tileColour);
}
Program: 173329
Project: 173329
Buggy source:
public List<String> getTileColours(){
  return tileColours;
}

Fixed version (ground truth):
@Deprecated public List<String> getTileColours(){
  return tileColours;
}
Program: 173331
Project: 173331
Buggy source:
@Override public boolean setPossibleActions(){
  if (manditoryNextAction != null) {
    possibleActions.add(manditoryNextAction);
    return true;
  }
  if (getStep() == GameDef.OrStep.INITIAL) {
    if (operatingCompany.value() instanceof PublicCompany_1880) {
      initTurn();
      if ((noMapMode) || (!((PublicCompany_1880)operatingCompany.value()).hasBuildingRightForPhase(gameManager.getCurrentPhase()))) {
        nextStep(GameDef.OrStep.LAY_TRACK);
      }
 else {
        initNormalTileLays();
        setStep(GameDef.OrStep.LAY_TRACK);
      }
    }
  }
  if ((getStep() == GameDef.OrStep.BUY_TRAIN) && (operatingCompany.value() instanceof Investor_1880)) {
    Investor_1880 investor=(Investor_1880)(operatingCompany.value());
    if (investor.isConnectedToLinkedCompany()) {
      possibleActions.add(new CloseInvestor_1880((Investor_1880)operatingCompany.value()));
      return true;
    }
  }
  return super.setPossibleActions();
}

Fixed version (ground truth):
@Override public boolean setPossibleActions(){
  if (manditoryNextAction != null) {
    possibleActions.add(manditoryNextAction);
    return true;
  }
  if (getStep() == GameDef.OrStep.INITIAL) {
    if (operatingCompany.value() instanceof PublicCompany_1880) {
      initTurn();
      if (operatingCompany.value() instanceof Investor_1880) {
        if (gameManager.getCurrentPhase().getId().equals("String_Node_Str")) {
          setStep(GameDef.OrStep.BUY_TRAIN);
        }
      }
      if ((noMapMode) || (!((PublicCompany_1880)operatingCompany.value()).hasBuildingRightForPhase(gameManager.getCurrentPhase()))) {
        nextStep(GameDef.OrStep.LAY_TRACK);
      }
 else {
        initNormalTileLays();
        setStep(GameDef.OrStep.LAY_TRACK);
      }
    }
  }
  if ((getStep() == GameDef.OrStep.BUY_TRAIN) && (operatingCompany.value() instanceof Investor_1880)) {
    Investor_1880 investor=(Investor_1880)(operatingCompany.value());
    if (investor.isConnectedToLinkedCompany()) {
      possibleActions.add(new CloseInvestor_1880((Investor_1880)operatingCompany.value()));
      return true;
    }
  }
  return super.setPossibleActions();
}
Program: 173332
Project: 173332
Buggy source:
@Override protected boolean equalsAs(PossibleAction pa,boolean asOption){
  if (pa == this)   return true;
  if (!super.equalsAs(pa,asOption))   return false;
  StartCompany_18EU action=(StartCompany_18EU)pa;
  boolean options=Objects.equal(this.minorsToMerge,action.minorsToMerge) && Objects.equal(this.requestStartSpaces,action.requestStartSpaces) && Objects.equal(this.availableHomeStations,action.availableHomeStations);
  if (asOption)   return options;
  return options && Objects.equal(this.chosenMinor,action.chosenMinor) && Objects.equal(this.selectedHomeStation,action.selectedHomeStation);
}

Fixed version (ground truth):
@Override protected boolean equalsAs(PossibleAction pa,boolean asOption){
  if (pa == this)   return true;
  if (!super.equalsAs(pa,asOption))   return false;
  StartCompany_18EU action=(StartCompany_18EU)pa;
  boolean options=Objects.equal(this.requestStartSpaces,action.requestStartSpaces) && RailsObjects.elementEquals(this.minorsToMerge,action.minorsToMerge);
  if (asOption)   return options;
  return options && Objects.equal(this.chosenMinor,action.chosenMinor) && Objects.equal(this.selectedHomeStation,action.selectedHomeStation);
}
Program: 173333
Project: 173333
Buggy source:
@Override public boolean isSoldOut(){
  if (!isBuyable())   return false;
  for (  PublicCertificate cert : certificates.view()) {
    Owner owner=cert.getOwner();
    if (owner instanceof BankPortfolio && owner != Bank.getUnavailable(this)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isSoldOut(){
  if (!hasStarted())   return false;
  for (  PublicCertificate cert : certificates.view()) {
    Owner owner=cert.getOwner();
    if (owner instanceof BankPortfolio && owner != Bank.getUnavailable(this)) {
      return false;
    }
  }
  return true;
}
Program: 173337
Project: 173337
Buggy source:
public boolean verify(JComponent arg0){
  List<String> players=window.getPlayers();
  window.setPlayers(players);
  int nextPlayerNr=players.size();
  if (nextPlayerNr < window.getSelectedGame().getMaxPlayers()) {
    if (!window.isPlayerEnabled(nextPlayerNr)) {
      window.enablePlayer(nextPlayerNr);
      window.setFocus(nextPlayerNr);
    }
  }
  if (nextPlayerNr + 1 < window.getSelectedGame().getMaxPlayers()) {
    window.disablePlayer(nextPlayerNr + 1);
  }
  return true;
}

Fixed version (ground truth):
public boolean verify(JComponent arg0){
  List<String> players=window.getPlayers();
  window.setPlayers(players);
  int nextPlayerNr=players.size();
  if (nextPlayerNr < window.getSelectedGame().getMaxPlayers()) {
    if (!window.isPlayerEnabled(nextPlayerNr)) {
      window.enablePlayer(nextPlayerNr);
      window.setFocus(nextPlayerNr);
    }
  }
  while (++nextPlayerNr < window.getSelectedGame().getMaxPlayers()) {
    window.disablePlayer(nextPlayerNr);
  }
  return true;
}
Program: 173339
Project: 173339
Buggy source:
private String getStartItemDescription(StartItem item){
  StringBuffer b=new StringBuffer("String_Node_Str");
  b.append(item.getPrimary().toString());
  if (item.getPrimary() instanceof PrivateCompany) {
    PrivateCompany priv=(PrivateCompany)item.getPrimary();
    b.append("String_Node_Str").append(Bank.format(item,priv.getRevenue()));
    List<MapHex> blockedHexes=priv.getBlockedHexes();
    if (blockedHexes == null) {
    }
 else     if (blockedHexes.size() == 1) {
      b.append("String_Node_Str").append(blockedHexes.get(0).getId());
    }
 else     if (blockedHexes.size() > 1) {
      b.append("String_Node_Str");
      for (      MapHex hex : blockedHexes) {
        b.append("String_Node_Str").append(hex.getId());
      }
    }
    if (priv.hasSpecialProperties()) {
      b.append("String_Node_Str");
      for (      SpecialProperty sp : priv.getSpecialProperties()) {
        b.append("String_Node_Str").append(sp.toString());
      }
    }
    List<String> preventClosingConditions=priv.getPreventClosingConditions();
    if (!preventClosingConditions.isEmpty()) {
      b.append("String_Node_Str");
      for (      String condition : preventClosingConditions) {
        b.append("String_Node_Str").append(condition);
      }
    }
  }
  if (item.getSecondary() != null) {
    b.append("String_Node_Str");
    b.append(item.getSecondary().toString());
  }
  return b.toString();
}

Fixed version (ground truth):
private String getStartItemDescription(StartItem item){
  StringBuffer b=new StringBuffer("String_Node_Str");
  b.append(item.getPrimary().toString());
  if (item.getPrimary() instanceof PrivateCompany) {
    PrivateCompany priv=(PrivateCompany)item.getPrimary();
    b.append("String_Node_Str").append(Bank.format(item,priv.getRevenue()));
    List<MapHex> blockedHexes=priv.getBlockedHexes();
    if (blockedHexes == null) {
    }
 else     if (blockedHexes.size() == 1) {
      b.append("String_Node_Str").append(blockedHexes.get(0).getId());
    }
 else     if (blockedHexes.size() > 1) {
      b.append("String_Node_Str");
      for (      MapHex hex : blockedHexes) {
        b.append("String_Node_Str").append(hex.getId());
      }
    }
    if (priv.hasSpecialProperties()) {
      b.append("String_Node_Str");
      for (      SpecialProperty sp : priv.getSpecialProperties()) {
        b.append("String_Node_Str").append(sp.getInfo());
      }
    }
    List<String> preventClosingConditions=priv.getPreventClosingConditions();
    if (!preventClosingConditions.isEmpty()) {
      b.append("String_Node_Str");
      for (      String condition : preventClosingConditions) {
        b.append("String_Node_Str").append(condition);
      }
    }
  }
  if (item.getSecondary() != null) {
    b.append("String_Node_Str");
    b.append(item.getSecondary().toText());
  }
  return b.toString();
}
Program: 173341
Project: 173341
Buggy source:
private void resetStartPacketPrices(int i){
  List<StartItem> startItems=startPacket.getItems();
  for (  StartItem item : startItems) {
    if ((!item.isSold()) && (item.getStatus() == StartItem.BUYABLE)) {
      item.reduceBasePriceBy(-(i * 10));
    }
  }
}

Fixed version (ground truth):
private void resetStartPacketPrices(int i){
  List<StartItem> startItems=startPacket.getItems();
  for (  StartItem item : startItems) {
    if ((!item.isSold()) && (item.getStatus() == StartItem.BUYABLE)) {
      item.reduceBasePriceBy(-(i * 10));
      if (item.getId() == "String_Node_Str") {
        item.reduceBasePriceBy(5);
      }
    }
  }
}
Program: 173342
Project: 173342
Buggy source:
public void closeInvestor(CloseInvestor_1880 action){
  String[] cashOptions=new String[2];
  cashOptions[0]=LocalText.getText("String_Node_Str",action.getInvestor().getCash(),action.getInvestor().getLinkedCompany().getId());
  cashOptions[1]=LocalText.getText("String_Node_Str",(action.getInvestor().getCash() / 5),action.getInvestor().getPresident());
  String cashChoice=(String)JOptionPane.showInputDialog(orWindow,LocalText.getText("String_Node_Str",action.getInvestor().getId()),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,cashOptions,cashOptions[0]);
  if (cashChoice == cashOptions[0]) {
    action.setTreasuryToLinkedCompany(true);
  }
 else {
    action.setTreasuryToLinkedCompany(false);
  }
  if (action.getInvestor().getLinkedCompany().getNumberOfFreeBaseTokens() > 0) {
    String[] tokenOptions=new String[2];
    tokenOptions[0]=LocalText.getText("String_Node_Str",action.getInvestor().getId(),action.getInvestor().getLinkedCompany().getId());
    tokenOptions[1]=LocalText.getText("String_Node_Str",action.getInvestor().getId(),action.getInvestor().getLinkedCompany().getId());
    String tokenChoice=(String)JOptionPane.showInputDialog(orWindow,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,tokenOptions,tokenOptions[0]);
    if (tokenChoice == tokenOptions[0]) {
      action.setReplaceToken(true);
    }
 else {
      action.setReplaceToken(false);
    }
  }
 else {
    action.setReplaceToken(false);
  }
  orWindow.process(action);
}

Fixed version (ground truth):
public void closeInvestor(CloseInvestor_1880 action){
  String[] cashOptions=new String[2];
  cashOptions[0]=LocalText.getText("String_Node_Str",action.getInvestor().getCash(),action.getInvestor().getLinkedCompany().getId());
  cashOptions[1]=LocalText.getText("String_Node_Str",(action.getInvestor().getCash() / 5),action.getInvestor().getPresident().getId());
  String cashChoice=(String)JOptionPane.showInputDialog(orWindow,LocalText.getText("String_Node_Str",action.getInvestor().getId()),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,cashOptions,cashOptions[0]);
  if (cashChoice == cashOptions[0]) {
    action.setTreasuryToLinkedCompany(true);
  }
 else {
    action.setTreasuryToLinkedCompany(false);
  }
  if (action.getInvestor().getLinkedCompany().getNumberOfFreeBaseTokens() > 0) {
    String[] tokenOptions=new String[2];
    tokenOptions[0]=LocalText.getText("String_Node_Str",action.getInvestor().getId(),action.getInvestor().getLinkedCompany().getId());
    tokenOptions[1]=LocalText.getText("String_Node_Str",action.getInvestor().getId(),action.getInvestor().getLinkedCompany().getId());
    String tokenChoice=(String)JOptionPane.showInputDialog(orWindow,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,tokenOptions,tokenOptions[0]);
    if (tokenChoice == tokenOptions[0]) {
      action.setReplaceToken(true);
    }
 else {
      action.setReplaceToken(false);
    }
  }
 else {
    action.setReplaceToken(false);
  }
  orWindow.process(action);
}
Program: 173343
Project: 173343
Buggy source:
private void setNextBiddingPlayer(){
  Player currentPlayer;
  do {
    currentPlayer=playerManager.setCurrentToNextPlayer();
  }
 while (((StartItem)currentAuctionItem.value()).getBid(currentPlayer) != 0);
}

Fixed version (ground truth):
private void setNextBiddingPlayer(){
  Player currentPlayer;
  do {
    currentPlayer=playerManager.setCurrentToNextPlayer();
  }
 while (((StartItem)currentAuctionItem.value()).isActive(currentPlayer) == false);
}
Program: 173346
Project: 173346
Buggy source:
@Override public String getUpgradeText(){
  String text=null;
  if (action instanceof LayBaseToken) {
    text="String_Node_Str";
    if (action.getPotentialCost(hex.getHex()) != 0) {
      String cost=Bank.format(action.getCompany(),action.getPotentialCost(hex.getHex()));
      text+=LocalText.getText("String_Node_Str",cost);
    }
    if (action.getSpecialProperty() != null) {
      text+="String_Node_Str" + action.getSpecialProperty().getOriginalCompany().getId() + "String_Node_Str";
    }
    if (isValid() && !hasSingleSelection()) {
      text+="String_Node_Str";
      text+=hex.getHex().getConnectionString(selectedStop.getRelatedStation());
      text+="String_Node_Str";
    }
    text+="String_Node_Str";
  }
 else   if (action instanceof LayBonusToken) {
    BonusToken token=((LayBonusToken)action).getSpecialProperty().getToken();
    text=token.getId();
  }
  return text;
}

Fixed version (ground truth):
@Override public String getUpgradeText(){
  String text=null;
  if (action instanceof LayBaseToken) {
    text="String_Node_Str";
    if (action.getPotentialCost(hex.getHex()) != 0) {
      String cost=Bank.format(action.getCompany(),action.getPotentialCost(hex.getHex()));
      text+=LocalText.getText("String_Node_Str",cost);
    }
 else {
      text+=LocalText.getText("String_Node_Str");
    }
    if (action.getSpecialProperty() != null) {
      text+="String_Node_Str" + action.getSpecialProperty().getOriginalCompany().getId() + "String_Node_Str";
    }
    if (isValid() && !hasSingleSelection()) {
      text+="String_Node_Str";
      text+=hex.getHex().getConnectionString(selectedStop.getRelatedStation());
      text+="String_Node_Str";
    }
    text+="String_Node_Str";
  }
 else   if (action instanceof LayBonusToken) {
    BonusToken token=((LayBonusToken)action).getSpecialProperty().getToken();
    text=token.getId();
  }
  return text;
}
Program: 173347
Project: 173347
Buggy source:
@Override public int getPotentialCost(MapHex hex){
  if (hex == null) {
    return 0;
  }
 else {
    return company.getBaseTokenLayCost(hex);
  }
}

Fixed version (ground truth):
@Override public int getPotentialCost(MapHex hex){
  if (hex == null) {
    return 0;
  }
 else {
    if (specialProperty != null && ((SpecialBaseTokenLay)specialProperty).isFree()) {
      return 0;
    }
 else {
      return company.getBaseTokenLayCost(hex);
    }
  }
}
Program: 173348
Project: 173348
Buggy source:
@Override public boolean isSoldOut(){
  Owner owner;
  String name;
  if ("String_Node_Str".equalsIgnoreCase(GameOption.getValue(this,"String_Node_Str"))) {
    for (    PublicCertificate cert : certificates.view()) {
      owner=cert.getOwner();
      name=cert.getName();
      if ((owner instanceof BankPortfolio || owner == cert.getCompany()) && (!name.equalsIgnoreCase("String_Node_Str"))) {
        return false;
      }
    }
    return true;
  }
  return super.isSoldOut();
}

Fixed version (ground truth):
@Override public boolean isSoldOut(){
  if (!isBuyable())   return false;
  for (  PublicCertificate cert : certificates.view()) {
    Owner owner=cert.getOwner();
    if (owner instanceof BankPortfolio && owner != Bank.getUnavailable(this)) {
      return false;
    }
  }
  return true;
}
Program: 173349
Project: 173349
Buggy source:
/** 
 * @author Martin
 */
public PublicCompany_1835(RailsItem parent,String Id){
  super(parent,Id);
}

Fixed version (ground truth):
public PublicCompany_1835(RailsItem parent,String Id){
  super(parent,Id);
}
Program: 173350
Project: 173350
Buggy source:
/** 
 * @see rails.common.parser.ConfigurableComponent#configureFromXML(org.w3c.dom.Element)
 */
public void configureFromXML(Tag tag) throws ConfigurationException {
  name=tag.getAttributeAsString("String_Node_Str");
  cost=tag.getAttributeAsInteger("String_Node_Str");
  majorStops=tag.getAttributeAsInteger("String_Node_Str");
  minorStops=tag.getAttributeAsInteger("String_Node_Str");
  Tag reachTag=tag.getChild("String_Node_Str");
  if (reachTag != null) {
    reachBasis=reachTag.getAttributeAsString("String_Node_Str",reachBasis);
    countTowns=reachTag.getAttributeAsString("String_Node_Str",countTowns);
  }
  Tag scoreTag=tag.getChild("String_Node_Str");
  if (scoreTag != null) {
    scoreTowns=scoreTag.getAttributeAsString("String_Node_Str",scoreTowns);
    scoreCities=scoreTag.getAttributeAsString("String_Node_Str",scoreCities);
  }
  countHexes=reachBasis.equals("String_Node_Str");
  townCountIndicator=countTowns.equals("String_Node_Str") ? NO_TOWN_COUNT : minorStops > 0 ? TOWN_COUNT_MINOR : TOWN_COUNT_MAJOR;
  cityScoreFactor=scoreCities.equals("String_Node_Str") ? 2 : 1;
  townScoreFactor=scoreTowns.equals("String_Node_Str") ? 1 : 0;
}

Fixed version (ground truth):
/** 
 * @see rails.common.parser.ConfigurableComponent#configureFromXML(org.w3c.dom.Element)
 */
public void configureFromXML(Tag tag) throws ConfigurationException {
  name=tag.getAttributeAsString("String_Node_Str");
  cost=tag.getAttributeAsInteger("String_Node_Str");
  majorStops=tag.getAttributeAsInteger("String_Node_Str");
  minorStops=tag.getAttributeAsInteger("String_Node_Str");
  Tag reachTag=tag.getChild("String_Node_Str");
  if (reachTag != null) {
    reachBasis=reachTag.getAttributeAsString("String_Node_Str",reachBasis);
    countTowns=reachTag.getAttributeAsString("String_Node_Str",countTowns);
  }
  Tag scoreTag=tag.getChild("String_Node_Str");
  if (scoreTag != null) {
    scoreTowns=scoreTag.getAttributeAsString("String_Node_Str",scoreTowns);
    scoreCities=scoreTag.getAttributeAsString("String_Node_Str",scoreCities);
  }
  countHexes=reachBasis.equals("String_Node_Str");
  townCountIndicator=countTowns.equals("String_Node_Str") ? NO_TOWN_COUNT : minorStops > 0 ? TOWN_COUNT_MINOR : TOWN_COUNT_MAJOR;
  cityScoreFactor=scoreCities.equalsIgnoreCase("String_Node_Str") ? 2 : 1;
  townScoreFactor=scoreTowns.equalsIgnoreCase("String_Node_Str") ? 1 : 0;
}
Program: 173351
Project: 173351
Buggy source:
public void nextSelection(){
  if (activeUpgrade.hasSingleSelection()) {
  }
 else {
    activeUpgrade.nextSelection();
    upgradeToLabels.get(activeUpgrade).update();
    activeHex.update();
    SoundManager.notifyOfSelectUpgrade(activeUpgrade);
  }
}

Fixed version (ground truth):
public void nextSelection(){
  if (activeUpgrade == null || activeUpgrade.hasSingleSelection()) {
  }
 else {
    activeUpgrade.nextSelection();
    upgradeToLabels.get(activeUpgrade).update();
    activeHex.update();
    SoundManager.notifyOfSelectUpgrade(activeUpgrade);
  }
}
Program: 173352
Project: 173352
Buggy source:
/** 
 * Register a bid. <p> This method does <b>not</b> check off the amount of money that a player has available for bidding.
 * @param amount The bid amount.
 * @param bidder The bidding player.special amounts are 0 for 18EU as buy price, -1 as standard pass, -2 and below as pass in 18EU 
 */
public void setBid(int amount,Player bidder){
  if (amount == -1) {
    setPass(bidder);
  }
 else {
    int index=bidder.getIndex();
    bids[index].set(amount);
    bids[index].setSuppressZero(false);
    active[index]=true;
    lastBidderIndex.set(index);
    minimumBid.set(amount + 5);
  }
}

Fixed version (ground truth):
/** 
 * Register a bid. <p> This method does <b>not</b> check off the amount of money that a player has available for bidding.
 * @param amount The bid amount.
 * @param bidder The bidding player.amount of -1 indicates a pass 
 */
public void setBid(int amount,Player bidder){
  if (amount == -1) {
    setPass(bidder);
  }
 else   if (amount > 0) {
    int index=bidder.getIndex();
    bids[index].set(amount);
    bids[index].setSuppressZero(false);
    active[index]=true;
    lastBidderIndex.set(index);
    minimumBid.set(amount + 5);
  }
}
Program: 173353
Project: 173353
Buggy source:
public NetworkMultigraph getMultigraph(PublicCompany company,Collection<NetworkVertex> protectedVertices){
  return NetworkMultigraph.create(getRevenueGraph(company,protectedVertices),protectedVertices);
}

Fixed version (ground truth):
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;
}
Program: 173354
Project: 173354
Buggy source:
public NetworkGraph getMapGraph(){
  return NetworkGraph.createMapGraph(root);
}

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

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

Fixed version (ground truth):
public NetworkGraph getRouteGraph(PublicCompany company,boolean addHQ){
  routeGraph=NetworkGraph.createRouteGraph(getMapGraph(),company,addHQ);
  this.company=company;
  this.addHQ=addHQ;
  log.info("String_Node_Str");
  return routeGraph;
}
Program: 173357
Project: 173357
Buggy source:
public void populateFromRails(){
  graph=networkAdapter.getRouteGraph(company,false);
  NetworkVertex.initAllRailsVertices(graph,company,phase);
  addStartVertices(graph.getCompanyBaseTokenVertexes(company));
  defineVertexVisitSets();
  defineRevenueBonuses();
  for (  Train train : company.getPortfolioModel().getTrainList()) {
    addTrain(train);
  }
  if (revenueManager != null) {
    revenueManager.initStaticModifiers(this);
  }
}

Fixed version (ground truth):
public void populateFromRails(){
  graph=networkAdapter.getRouteGraphCached(company,false);
  NetworkVertex.initAllRailsVertices(graph,company,phase);
  addStartVertices(graph.getCompanyBaseTokenVertexes(company));
  defineVertexVisitSets();
  defineRevenueBonuses();
  for (  Train train : company.getPortfolioModel().getTrainList()) {
    addTrain(train);
  }
  if (revenueManager != null) {
    revenueManager.initStaticModifiers(this);
  }
}
Program: 173358
Project: 173358
Buggy source:
@Override public void resume(){
  PublicCompany prussian=companyManager.getPublicCompany(GameManager_1835.PR_ID);
  if (prussian.hasFloated() && !prussian.hasOperated() && operatingCompany.value() == companyManager.getPublicCompany("String_Node_Str")) {
    log.debug("String_Node_Str");
    int index=0;
    int operatingCompanyndex=getOperatingCompanyndex();
    for (    PublicCompany company : setOperatingCompanies()) {
      if (index > operatingCompanyndex && company.hasStockPrice() && company.hasFloated() && !company.isClosed() && company != operatingCompany.value() && company.getCurrentSpace().getPrice() < prussian.getCurrentSpace().getPrice()) {
        log.debug("String_Node_Str" + company.getId());
        break;
      }
      index++;
    }
    operatingCompanies.add(index,prussian);
    log.debug("String_Node_Str" + index);
  }
 else {
    log.debug("String_Node_Str");
  }
  guiHints.setCurrentRoundType(getClass());
  super.resume();
}

Fixed version (ground truth):
@Override public void resume(){
  PublicCompany prussian=companyManager.getPublicCompany(GameManager_1835.PR_ID);
  if (prussian.hasFloated() && !prussian.hasOperated() && operatingCompany.value() == companyManager.getPublicCompany("String_Node_Str")) {
    log.debug("String_Node_Str");
    int index=0;
    int operatingCompanyndex=getOperatingCompanyndex();
    for (    PublicCompany company : setOperatingCompanies()) {
      if (index > operatingCompanyndex && company.hasStockPrice() && company.hasFloated() && !company.isClosed() && company != operatingCompany.value() && company.getCurrentSpace().getPrice() < prussian.getCurrentSpace().getPrice()) {
        log.debug("String_Node_Str" + company.getId());
        break;
      }
      index++;
    }
    operatingCompanies.add(index,prussian);
    log.debug("String_Node_Str" + index);
  }
 else {
    log.debug("String_Node_Str");
  }
  if (operatingCompany.value().isClosed())   finishTurn();
  guiHints.setCurrentRoundType(getClass());
  super.resume();
}
Program: 173359
Project: 173359
Buggy source:
/** 
 * Set the start item sold status.
 * @param sold The new sold status (usually true).
 */
public void setSold(Player player,int buyPrice){
  status.set(SOLD);
  lastBidder.set(player);
  for (  Player p : bids.keySet()) {
    CountingMoneyModel bid=bids.get(p);
    if (bid.value() > 0) {
      p.unblockCash(bid.value());
      if (p != player) {
        bid.set(0);
        bid.setSuppressZero(true);
      }
 else {
        bid.set(buyPrice);
      }
      active.get(p).set(false);
      ;
    }
  }
  minimumBid.set(0);
}

Fixed version (ground truth):
/** 
 * Set the start item sold status.
 * @param sold The new sold status (usually true).
 */
public void setSold(Player player,int buyPrice){
  status.set(SOLD);
  lastBidder.set(player);
  for (  Player p : bids.keySet()) {
    CountingMoneyModel bid=bids.get(p);
    if (bid.value() > 0) {
      p.unblockCash(bid.value());
      if (p != player) {
        bid.set(0);
        bid.setSuppressZero(true);
      }
      active.get(p).set(false);
      ;
    }
  }
  bids.get(player).set(buyPrice);
  minimumBid.set(0);
}
Program: 173360
Project: 173360
Buggy source:
@Override public void nextRound(Round round){
  if (round instanceof StartRound) {
    if (((StartRound)round).getStartPacket().areAllSold()) {
      beginStartRound();
    }
 else {
      startOperatingRound(runIfStartPacketIsNotCompletelySold());
    }
    numOfORs.set(10);
  }
 else   if (round instanceof StockRound) {
    relativeORNumber.set(1);
    orControl.startedFromStockRound();
    startOperatingRound(true);
  }
 else   if (round instanceof OperatingRound_1880) {
    if ((orControl.isFinalOperatingRoundSequence()) && (getRelativeORNumber() == 3)) {
      finishGame();
    }
 else     if (getRoot().getCompanyManager().getNextUnfinishedStartPacket() != null) {
      beginStartRound();
    }
 else     if (orControl.isExitingToStockRound() == true) {
      startStockRound();
    }
 else {
      orControl.startedFromOperatingRound();
      relativeORNumber.add(1);
      startOperatingRound(true);
    }
  }
}

Fixed version (ground truth):
@Override public void nextRound(Round round){
  if (round instanceof StartRound) {
    if (((StartRound)round).getStartPacket().areAllSold()) {
      beginStartRound();
    }
 else {
      startOperatingRound(runIfStartPacketIsNotCompletelySold());
    }
    numOfORs.set(10);
  }
 else   if (round instanceof StockRound) {
    relativeORNumber.set(1);
    orControl.startedFromStockRound();
    startOperatingRound(true);
  }
 else   if (round instanceof OperatingRound_1880) {
    if (orControl.getFinalOperatingRoundSequenceNumber() > 3) {
      finishGame();
    }
 else     if (getRoot().getCompanyManager().getNextUnfinishedStartPacket() != null) {
      beginStartRound();
    }
 else     if (orControl.isExitingToStockRound() == true) {
      startStockRound();
    }
 else {
      orControl.startedFromOperatingRound();
      relativeORNumber.add(1);
      startOperatingRound(true);
    }
  }
}
Program: 173361
Project: 173361
Buggy source:
public void setColorModel(final ColorModel colorModel){
  Observer colorObserver=new Observer(){
    public void update(    String text){
      if (colorModel.getBackground() != null) {
        Field.this.setBackground(colorModel.getBackground());
      }
      if (colorModel.getForeground() != null) {
        Field.this.setForeground(colorModel.getForeground());
      }
    }
    public Observable getObservable(){
      return colorModel;
    }
  }
;
  colorModel.addObserver(colorObserver);
  colorObserver.update(null);
}

Fixed version (ground truth):
public void setColorModel(ColorModel colorModel){
  final ColorModel storeModel=colorModel;
  colorObserver=new Observer(){
    public void update(    String text){
      if (storeModel.getBackground() != null) {
        setBackground(storeModel.getBackground());
      }
 else {
        setBackground(NORMAL_BG_COLOUR);
      }
      if (storeModel.getForeground() != null) {
        setForeground(storeModel.getForeground());
      }
    }
    public Observable getObservable(){
      return storeModel;
    }
  }
;
  colorModel.addObserver(colorObserver);
  colorObserver.update(null);
}
Program: 173362
Project: 173362
Buggy source:
public String getTypeId(){
  return certTypeId;
}

Fixed version (ground truth):
public String getTypeId(){
  String certTypeId=company.getId() + "String_Node_Str" + getShare()+ "String_Node_Str";
  if (president)   certTypeId+="String_Node_Str";
  return certTypeId;
}
Program: 173363
Project: 173363
Buggy source:
/** 
 * @param companyI
 */
public void setCompany(PublicCompany companyI){
  company=companyI;
  certTypeId=company.getId() + "String_Node_Str" + getShare()+ "String_Node_Str";
  if (president)   certTypeId+="String_Node_Str";
}

Fixed version (ground truth):
public void setCompany(PublicCompany companyI){
  company=companyI;
}
Program: 173364
Project: 173364
Buggy source:
/** 
 * @return
 */
public PublicCompany getCompany(){
  return company;
}

Fixed version (ground truth):
public PublicCompany getCompany(){
  return company;
}
Program: 173365
Project: 173365
Buggy source:
/** 
 * @param b
 */
public boolean isInitiallyAvailable(){
  return initiallyAvailable;
}

Fixed version (ground truth):
public boolean isInitiallyAvailable(){
  return initiallyAvailable;
}
Program: 173366
Project: 173366
Buggy source:
public PublicCompany getType(){
  return company;
}

Fixed version (ground truth):
@Override public PublicCompany getType(){
  return company;
}
Program: 173367
Project: 173367
Buggy source:
/** 
 * @param b
 */
public void setPresident(boolean b){
  president=b;
}

Fixed version (ground truth):
public void setPresident(boolean b){
  president=b;
}
Program: 173368
Project: 173368
Buggy source:
private List<NetworkVertex> extractExpressRun(RevenueTrainRun run,int length){
  if (!run.hasAValidRun())   return new ArrayList<NetworkVertex>();
  NetworkVertex baseVertex=run.getBaseVertex();
  List<NetworkVertex> otherVertices=new ArrayList<NetworkVertex>(run.getUniqueVertices());
  otherVertices.remove(baseVertex);
  Collections.sort(otherVertices);
  List<NetworkVertex> expressVertices=otherVertices.subList(0,Math.min(otherVertices.size(),length - 1));
  expressVertices.add(0,baseVertex);
  return expressVertices;
}

Fixed version (ground truth):
private List<NetworkVertex> extractExpressRun(RevenueTrainRun run,int length){
  if (!run.hasAValidRun())   return new ArrayList<NetworkVertex>();
  NetworkVertex baseVertex=run.getBaseVertex();
  List<NetworkVertex> otherVertices=new ArrayList<NetworkVertex>(run.getUniqueVertices());
  otherVertices.remove(baseVertex);
  Collections.sort(otherVertices,new NetworkVertex.ValueOrder());
  List<NetworkVertex> expressVertices=otherVertices.subList(0,Math.min(otherVertices.size(),length - 1));
  expressVertices.add(0,baseVertex);
  return expressVertices;
}