Program: 173853
Project: 173853
Buggy source:
/** 
 * Create a list of certificates that a player may buy in a Stock Round, taking all rules into account.
 * @return List of buyable certificates.
 */
public List getBuyableCerts(){
  List buyableCerts=new ArrayList();
  if (!mayCurrentPlayerBuyAtAll() || !currentPlayer.mayBuyCertificates(1))   return buyableCerts;
  List certs;
  PublicCertificateI cert;
  TradeableCertificate tCert;
  PublicCompanyI comp;
  int price;
  int playerCash=currentPlayer.getCash();
  String compName;
  Map map=Bank.getIpo().getCertsPerCompanyMap();
  int lowestStartPrice=999;
  int highestStartPrice=0;
  int shares;
  int[] startPrices=stockMarket.getStartPrices();
  for (Iterator it=map.keySet().iterator(); it.hasNext(); ) {
    compName=(String)it.next();
    certs=(List)map.get(compName);
    if (certs == null || certs.isEmpty())     continue;
    cert=(PublicCertificateI)certs.get(0);
    comp=cert.getCompany();
    if (isSaleRecorded(currentPlayer,comp))     continue;
    if (!currentPlayer.mayBuyCompanyShare(comp,1))     continue;
    shares=cert.getShares();
    if (!comp.hasStarted()) {
      for (int i=0; i < startPrices.length; i++) {
        if (startPrices[i] * shares <= playerCash) {
          buyableCerts.add(new TradeableCertificate(cert,startPrices[i]));
        }
      }
    }
 else     if (comp.hasParPrice()) {
      price=comp.getParPrice().getPrice() * cert.getShares();
      if (playerCash < price)       continue;
      buyableCerts.add(new TradeableCertificate(cert,price));
    }
 else {
      price=comp.getCurrentPrice().getPrice() * cert.getShares();
      if (playerCash < price)       continue;
      buyableCerts.add(new TradeableCertificate(cert,price));
    }
  }
  for (Iterator it=Bank.getPool().getUniqueTradeableCertificates().iterator(); it.hasNext(); ) {
    tCert=(TradeableCertificate)it.next();
    if (playerCash < tCert.getPrice())     continue;
    comp=tCert.getCert().getCompany();
    if (isSaleRecorded(currentPlayer,comp))     continue;
    if (!currentPlayer.mayBuyCompanyShare(comp,1))     continue;
    buyableCerts.add(tCert);
  }
  return buyableCerts;
}

Fixed version (ground truth):
/** 
 * Create a list of certificates that a player may buy in a Stock Round, taking all rules into account.
 * @return List of buyable certificates.
 */
public List getBuyableCerts(){
  List buyableCerts=new ArrayList();
  List certs;
  PublicCertificateI cert;
  TradeableCertificate tCert;
  PublicCompanyI comp;
  int price;
  int playerCash=currentPlayer.getCash();
  if (this.companyBoughtThisTurn == null) {
    String compName;
    Map map=Bank.getIpo().getCertsPerCompanyMap();
    int lowestStartPrice=999;
    int highestStartPrice=0;
    int shares;
    int[] startPrices=stockMarket.getStartPrices();
    for (Iterator it=map.keySet().iterator(); it.hasNext(); ) {
      compName=(String)it.next();
      certs=(List)map.get(compName);
      if (certs == null || certs.isEmpty())       continue;
      cert=(PublicCertificateI)certs.get(0);
      comp=cert.getCompany();
      if (isSaleRecorded(currentPlayer,comp))       continue;
      if (!currentPlayer.mayBuyCompanyShare(comp,1))       continue;
      shares=cert.getShares();
      if (!comp.hasStarted()) {
        for (int i=0; i < startPrices.length; i++) {
          if (startPrices[i] * shares <= playerCash) {
            buyableCerts.add(new TradeableCertificate(cert,startPrices[i]));
          }
        }
      }
 else       if (comp.hasParPrice()) {
        price=comp.getParPrice().getPrice() * cert.getShares();
        if (playerCash < price)         continue;
        buyableCerts.add(new TradeableCertificate(cert,price));
      }
 else {
        price=comp.getCurrentPrice().getPrice() * cert.getShares();
        if (playerCash < price)         continue;
        buyableCerts.add(new TradeableCertificate(cert,price));
      }
    }
  }
  for (Iterator it=Bank.getPool().getUniqueTradeableCertificates().iterator(); it.hasNext(); ) {
    tCert=(TradeableCertificate)it.next();
    if (playerCash < tCert.getPrice())     continue;
    comp=tCert.getCert().getCompany();
    if (isSaleRecorded(currentPlayer,comp))     continue;
    if (companyBoughtThisTurn != null) {
      if (comp != companyBoughtThisTurn)       continue;
      if (!comp.getCurrentPrice().isNoBuyLimit())       continue;
    }
    if (!currentPlayer.mayBuyCompanyShare(comp,1))     continue;
    if (!currentPlayer.mayBuyCertificate(comp,1))     continue;
    buyableCerts.add(tCert);
  }
  return buyableCerts;
}