Program: 173541
Project: 173541
Buggy source:
public boolean buyPrivate(BuyPrivate action){
  String errMsg=null;
  PublicCompany publicCompany=action.getCompany();
  String publicCompanyName=publicCompany.getId();
  PrivateCompany privateCompany=action.getPrivateCompany();
  String privateCompanyName=privateCompany.getId();
  int price=action.getPrice();
  Owner owner=null;
  Player player=null;
  int upperPrice;
  int lowerPrice;
  while (true) {
    if ((privateCompany=companyManager.getPrivateCompany(privateCompanyName)) == null) {
      errMsg=LocalText.getText("String_Node_Str",privateCompanyName);
      break;
    }
    if (privateCompany.isClosed()) {
      errMsg=LocalText.getText("String_Node_Str",privateCompanyName);
      break;
    }
    owner=privateCompany.getOwner();
    if (!(owner instanceof Player)) {
      errMsg=LocalText.getText("String_Node_Str",privateCompanyName);
      break;
    }
    player=(Player)owner;
    upperPrice=privateCompany.getUpperPrice();
    lowerPrice=privateCompany.getLowerPrice();
    if (!isPrivateSellingAllowed()) {
      errMsg=LocalText.getText("String_Node_Str");
      break;
    }
    if (lowerPrice != PrivateCompany.NO_PRICE_LIMIT && price < lowerPrice) {
      errMsg=LocalText.getText("String_Node_Str",Bank.format(price),Bank.format(lowerPrice),privateCompanyName);
      break;
    }
    if (upperPrice != PrivateCompany.NO_PRICE_LIMIT && price > upperPrice) {
      errMsg=LocalText.getText("String_Node_Str",Bank.format(price),Bank.format(lowerPrice),privateCompanyName);
      break;
    }
    if (price > operatingCompany.value().getCash()) {
      errMsg=LocalText.getText("String_Node_Str",publicCompanyName,Bank.format(operatingCompany.value().getCash()),Bank.format(price));
      break;
    }
    break;
  }
  if (errMsg != null) {
    if (owner != null) {
      DisplayBuffer.add(LocalText.getText("String_Node_Str",publicCompanyName,privateCompanyName,owner.getId(),Bank.format(price),errMsg));
    }
 else {
      DisplayBuffer.add(LocalText.getText("String_Node_Str",publicCompanyName,privateCompanyName,Bank.format(price),errMsg));
    }
    return false;
  }
  operatingCompany.value().buyPrivate(privateCompany,player,price);
  return true;
}

Fixed version (ground truth):
public boolean buyPrivate(BuyPrivate action){
  String errMsg=null;
  PublicCompany publicCompany=action.getCompany();
  String publicCompanyName=publicCompany.getId();
  PrivateCompany privateCompany=action.getPrivateCompany();
  String privateCompanyName=privateCompany.getId();
  int price=action.getPrice();
  Owner owner=null;
  Player player=null;
  int upperPrice;
  int lowerPrice;
  while (true) {
    if ((privateCompany=companyManager.getPrivateCompany(privateCompanyName)) == null) {
      errMsg=LocalText.getText("String_Node_Str",privateCompanyName);
      break;
    }
    if (privateCompany.isClosed()) {
      errMsg=LocalText.getText("String_Node_Str",privateCompanyName);
      break;
    }
    owner=privateCompany.getOwner();
    if (!(owner instanceof Player)) {
      errMsg=LocalText.getText("String_Node_Str",privateCompanyName);
      break;
    }
    player=(Player)owner;
    upperPrice=privateCompany.getUpperPrice();
    lowerPrice=privateCompany.getLowerPrice();
    if (!isPrivateSellingAllowed()) {
      errMsg=LocalText.getText("String_Node_Str");
      break;
    }
    if (lowerPrice != PrivateCompany.NO_PRICE_LIMIT && price < lowerPrice) {
      errMsg=LocalText.getText("String_Node_Str",Bank.format(price),Bank.format(lowerPrice),privateCompanyName);
      break;
    }
    if (upperPrice != PrivateCompany.NO_PRICE_LIMIT && price > upperPrice) {
      errMsg=LocalText.getText("String_Node_Str",Bank.format(price),Bank.format(lowerPrice),privateCompanyName);
      break;
    }
    if (price > operatingCompany.value().getCash()) {
      errMsg=LocalText.getText("String_Node_Str",publicCompanyName,Bank.format(operatingCompany.value().getCash()),Bank.format(price));
      break;
    }
    break;
  }
  if (errMsg != null) {
    if (owner != null) {
      DisplayBuffer.add(LocalText.getText("String_Node_Str",publicCompanyName,privateCompanyName,owner.getId(),Bank.format(price),errMsg));
    }
 else {
      DisplayBuffer.add(LocalText.getText("String_Node_Str",publicCompanyName,privateCompanyName,Bank.format(price),errMsg));
    }
    return false;
  }
  getRoot().getChangeStack().newChangeSet(action);
  operatingCompany.value().buyPrivate(privateCompany,player,price);
  return true;
}