Program: 173504
Project: 173504
Buggy source:
private void executeExchange(List<Company> companies,boolean president,boolean display){
  ExchangeForShare efs;
  PublicCertificate cert;
  Player player;
  for (  Company company : companies) {
    log.debug("String_Node_Str" + company.getId());
    if (company instanceof PrivateCompany) {
      player=(Player)((PrivateCompany)company).getOwner();
    }
 else {
      player=((PublicCompany)company).getPresident();
    }
    efs=(ExchangeForShare)Iterables.get(company.getSpecialProperties(),0);
    cert=unavailable.findCertificate(prussian,efs.getShare() / prussian.getShareUnit(),president);
    cert.moveTo(player);
    String message=LocalText.getText("String_Node_Str",player.getId(),company.getId(),PR_ID,company instanceof PrivateCompany ? "String_Node_Str" : Currency.format(this,((PublicCompany)company).getCash()),company instanceof PrivateCompany ? "String_Node_Str" : ((PublicCompany)company).getPortfolioModel().getTrainList().size());
    ReportBuffer.add(message);
    if (display)     DisplayBuffer.add(message);
    message=LocalText.getText("String_Node_Str",player.getId(),cert.getShare(),PR_ID,ipo.getId(),company.getId());
    ReportBuffer.add(message);
    if (display)     DisplayBuffer.add(message);
    if (company instanceof PublicCompany) {
      PublicCompany minor=(PublicCompany)company;
      BaseToken token=Iterables.get(minor.getAllBaseTokens(),0);
      Stop city=(Stop)token.getOwner();
      MapHex hex=city.getParent();
      token.moveTo(minor);
      if (!hex.hasTokenOfCompany(prussian) && hex.layBaseToken(prussian,city.getNumber())) {
        message=LocalText.getText("String_Node_Str",PR_ID,minor.getId(),city.getSpecificId());
        ReportBuffer.add(message);
        if (display)         DisplayBuffer.add(message);
        prussian.layBaseToken(hex,0);
      }
      if (minor.getCash() > 0) {
        Currency.wireAll(minor,prussian);
      }
      List<Train> trains=new ArrayList<Train>(minor.getPortfolioModel().getTrainList());
      for (      Train train : trains) {
        prussian.getPortfolioModel().addTrain(train);
      }
    }
    company.setClosed();
  }
}

Fixed version (ground truth):
private void executeExchange(List<Company> companies,boolean president,boolean display){
  ExchangeForShare efs;
  PublicCertificate cert;
  Player player;
  for (  Company company : companies) {
    log.debug("String_Node_Str" + company.getId());
    if (company instanceof PrivateCompany) {
      player=(Player)((PrivateCompany)company).getOwner();
    }
 else {
      player=((PublicCompany)company).getPresident();
    }
    efs=(ExchangeForShare)Iterables.get(company.getSpecialProperties(),0);
    cert=unavailable.findCertificate(prussian,efs.getShare() / prussian.getShareUnit(),president);
    cert.moveTo(player);
    String message=LocalText.getText("String_Node_Str",player.getId(),company.getId(),PR_ID,company instanceof PrivateCompany ? "String_Node_Str" : Currency.format(this,((PublicCompany)company).getCash()),company instanceof PrivateCompany ? "String_Node_Str" : ((PublicCompany)company).getPortfolioModel().getTrainList().size());
    ReportBuffer.add(message);
    if (display)     DisplayBuffer.add(message);
    message=LocalText.getText("String_Node_Str",player.getId(),cert.getShare(),PR_ID,ipo.getParent().getId(),company.getId());
    ReportBuffer.add(message);
    if (display)     DisplayBuffer.add(message);
    if (company instanceof PublicCompany) {
      PublicCompany minor=(PublicCompany)company;
      BaseToken token=Iterables.get(minor.getAllBaseTokens(),0);
      Stop city=(Stop)token.getOwner();
      MapHex hex=city.getParent();
      token.moveTo(minor);
      if (!hex.hasTokenOfCompany(prussian) && hex.layBaseToken(prussian,city.getNumber())) {
        message=LocalText.getText("String_Node_Str",PR_ID,minor.getId(),city.getSpecificId());
        ReportBuffer.add(message);
        if (display)         DisplayBuffer.add(message);
        prussian.layBaseToken(hex,0);
      }
      if (minor.getCash() > 0) {
        Currency.wireAll(minor,prussian);
      }
      List<Train> trains=new ArrayList<Train>(minor.getPortfolioModel().getTrainList());
      for (      Train train : trains) {
        prussian.getPortfolioModel().addTrain(train);
      }
    }
    company.setClosed();
  }
}