Program: 173496
Project: 173496
Buggy source:
/** 
 * Create a list of certificates that a player may sell in a Stock Round, taking all rules taken into account.
 * @return List of sellable certificates.
 */
public void setSellableShares(){
  if (!mayCurrentPlayerSellAnything())   return;
  int price;
  int number;
  int share, maxShareToSell;
  boolean dumpAllowed;
  PortfolioModel playerPortfolio=currentPlayer.getPortfolioModel();
  for (  PublicCompany company : companyManager.getAllPublicCompanies()) {
    if (!mayPlayerSellShareOfCompany(company))     continue;
    share=maxShareToSell=playerPortfolio.getShare(company);
    if (maxShareToSell == 0)     continue;
    maxShareToSell=Math.min(maxShareToSell,getGameParameterAsInt(GameDef.Parm.POOL_SHARE_LIMIT) - pool.getShare(company));
    if (maxShareToSell == 0)     continue;
    if (company.getPresident() == currentPlayer) {
      int presidentShare=company.getCertificates().get(0).getShare();
      if (maxShareToSell > share - presidentShare) {
        dumpAllowed=false;
        int playerShare;
        for (        Player player : gameManager.getPlayers()) {
          if (player == currentPlayer)           continue;
          playerShare=player.getPortfolioModel().getShare(company);
          if (playerShare >= presidentShare) {
            dumpAllowed=true;
            break;
          }
        }
        if (!dumpAllowed)         maxShareToSell=share - presidentShare;
      }
    }
    int[] shareCountPerUnit=new int[5];
    for (    PublicCertificate c : playerPortfolio.getCertificates(company)) {
      if (c.isPresidentShare()) {
        shareCountPerUnit[1]+=c.getShares();
      }
 else {
        ++shareCountPerUnit[c.getShares()];
      }
    }
    price=getCurrentSellPrice(company);
    for (int i=1; i <= 4; i++) {
      number=shareCountPerUnit[i];
      if (number == 0)       continue;
      if ((Boolean)gameManager.getGameParameter(GameDef.Parm.NO_SALE_OF_JUST_BOUGHT_CERT) && company.equals(companyBoughtThisTurnWrapper.value())) {
        number--;
      }
      if (number <= 0)       continue;
      number=Math.min(number,maxShareToSell / (i * company.getShareUnit()));
      if (number <= 0)       continue;
    }
  }
}

Fixed version (ground truth):
/** 
 * Create a list of certificates that a player may sell in a Stock Round, taking all rules taken into account.
 * @return List of sellable certificates.
 */
public void setSellableShares(){
  if (!mayCurrentPlayerSellAnything())   return;
  int price;
  int number;
  int share, maxShareToSell;
  boolean dumpAllowed;
  PortfolioModel playerPortfolio=currentPlayer.getPortfolioModel();
  for (  PublicCompany company : companyManager.getAllPublicCompanies()) {
    if (!mayPlayerSellShareOfCompany(company))     continue;
    share=maxShareToSell=playerPortfolio.getShare(company);
    if (maxShareToSell == 0)     continue;
    maxShareToSell=Math.min(maxShareToSell,getGameParameterAsInt(GameDef.Parm.POOL_SHARE_LIMIT) - pool.getShare(company));
    if (maxShareToSell == 0)     continue;
    if (company.getPresident() == currentPlayer) {
      int presidentShare=company.getCertificates().get(0).getShare();
      if (maxShareToSell > share - presidentShare) {
        dumpAllowed=false;
        int playerShare;
        for (        Player player : gameManager.getPlayers()) {
          if (player == currentPlayer)           continue;
          playerShare=player.getPortfolioModel().getShare(company);
          if (playerShare >= presidentShare) {
            dumpAllowed=true;
            break;
          }
        }
        if (!dumpAllowed)         maxShareToSell=share - presidentShare;
      }
    }
    int[] shareCountPerUnit=new int[5];
    for (    PublicCertificate c : playerPortfolio.getCertificates(company)) {
      if (c.isPresidentShare()) {
        shareCountPerUnit[1]+=c.getShares();
      }
 else {
        ++shareCountPerUnit[c.getShares()];
      }
    }
    price=getCurrentSellPrice(company);
    for (int i=1; i <= 4; i++) {
      number=shareCountPerUnit[i];
      if (number == 0)       continue;
      if ((Boolean)gameManager.getGameParameter(GameDef.Parm.NO_SALE_OF_JUST_BOUGHT_CERT) && company.equals(companyBoughtThisTurnWrapper.value())) {
        number--;
      }
      if (number <= 0)       continue;
      number=Math.min(number,maxShareToSell / (i * company.getShareUnit()));
      if (number <= 0)       continue;
      possibleActions.add(new SellShares(company.getId(),i,number,price));
    }
  }
}