Program: 173924
Project: 173924
Buggy source:
/** 
 * Sell one or more shares (one or multiple share units, normally 10% each).
 * @param player Name of the selling player.
 * @param company Name of the company of which shares are sold.
 * @param number The number of shares to sell.TODO Does not yet cater for double shares (incl. president). TODO Bank pool limit to be made configurable.
 * @return False if an error is found.
 */
public boolean sellShares(String playerName,String companyName,int number){
  Portfolio portfolio=currentPlayer.getPortfolio();
  String errMsg=null;
  PublicCompanyI company=null;
  currentPlayer=GameManager.getCurrentPlayer();
  while (true) {
    if (!playerName.equals(currentPlayer.getName())) {
      errMsg="String_Node_Str" + playerName;
      break;
    }
    if (sequenceRule == SELL_BUY_OR_BUY_SELL && hasBoughtThisTurn && hasSoldThisTurnBeforeBuying || sequenceRule == SELL_BUY && hasBoughtThisTurn) {
      errMsg="String_Node_Str";
      break;
    }
    company=companyMgr.getPublicCompany(companyName);
    if (company == null) {
      errMsg="String_Node_Str";
      break;
    }
    if (portfolio.countShares(company) < number) {
      errMsg="String_Node_Str";
      break;
    }
    if (pool.countShares(company) + number * company.getShareUnit() > 50) {
      errMsg="String_Node_Str";
      break;
    }
    break;
  }
  if (errMsg != null) {
    Log.error(playerName + "String_Node_Str" + number+ "String_Node_Str"+ companyName+ "String_Node_Str"+ errMsg);
    return false;
  }
  PublicCertificateI cert;
  int price=company.getCurrentPrice().getPrice();
  Log.write(playerName + "String_Node_Str" + number+ "String_Node_Str"+ (number * company.getShareUnit())+ "String_Node_Str"+ companyName+ "String_Node_Str"+ Bank.format(number * price));
  for (int i=0; i < number; i++) {
    cert=portfolio.findCertificate(company,false);
    pool.buyCertificate(cert,portfolio,cert.getShares() * price);
  }
  stockMarket.sell(company,number);
  if (!playersThatSoldThisRound.containsKey(currentPlayer)) {
    playersThatSoldThisRound.put(currentPlayer,new HashMap());
  }
  ((HashMap)playersThatSoldThisRound.get(currentPlayer)).put(company,null);
  if (!hasBoughtThisTurn)   hasSoldThisTurnBeforeBuying=true;
  hasPassed=false;
  setPriority();
  return true;
}

Fixed version (ground truth):
/** 
 * Sell one or more shares (one or multiple share units, normally 10% each).
 * @param player Name of the selling player.
 * @param company Name of the company of which shares are sold.
 * @param number The number of shares to sell.TODO Does not yet cater for double shares (incl. president).
 * @return False if an error is found.
 */
public boolean sellShares(String playerName,String companyName,int number){
  Portfolio portfolio=currentPlayer.getPortfolio();
  String errMsg=null;
  PublicCompanyI company=null;
  currentPlayer=GameManager.getCurrentPlayer();
  while (true) {
    if (!playerName.equals(currentPlayer.getName())) {
      errMsg="String_Node_Str" + playerName;
      break;
    }
    if (sequenceRule == SELL_BUY_OR_BUY_SELL && hasBoughtThisTurn && hasSoldThisTurnBeforeBuying || sequenceRule == SELL_BUY && hasBoughtThisTurn) {
      errMsg="String_Node_Str";
      break;
    }
    company=companyMgr.getPublicCompany(companyName);
    if (company == null) {
      errMsg="String_Node_Str";
      break;
    }
    if (portfolio.ownsShare(company) < number) {
      errMsg="String_Node_Str";
      break;
    }
    if (pool.ownsShare(company) + number * company.getShareUnit() > Bank.getPoolShareLimit()) {
      errMsg="String_Node_Str";
      break;
    }
    break;
  }
  if (errMsg != null) {
    Log.error(playerName + "String_Node_Str" + number+ "String_Node_Str"+ companyName+ "String_Node_Str"+ errMsg);
    return false;
  }
  PublicCertificateI cert;
  int price=company.getCurrentPrice().getPrice();
  Log.write(playerName + "String_Node_Str" + number+ "String_Node_Str"+ (number * company.getShareUnit())+ "String_Node_Str"+ companyName+ "String_Node_Str"+ Bank.format(number * price));
  for (int i=0; i < number; i++) {
    cert=portfolio.findCertificate(company,false);
    pool.buyCertificate(cert,portfolio,cert.getShares() * price);
  }
  stockMarket.sell(company,number);
  if (!playersThatSoldThisRound.containsKey(currentPlayer)) {
    playersThatSoldThisRound.put(currentPlayer,new HashMap());
  }
  ((HashMap)playersThatSoldThisRound.get(currentPlayer)).put(company,null);
  if (!hasBoughtThisTurn)   hasSoldThisTurnBeforeBuying=true;
  hasPassed=false;
  setPriority();
  return true;
}