Program: 173780
Project: 173780
Buggy source:
public void updateStatus(PossibleAction actionToComplete){
  mapRelatedActions.clear();
  orPanel.resetActions();
  if (actionToComplete != null) {
    log.debug("String_Node_Str" + actionToComplete);
  }
  orStep=oRound.getStep();
  orComp=oRound.getOperatingCompany();
  log.debug("String_Node_Str" + orCompIndex);
  log.debug("String_Node_Str" + orComp.getName());
  log.debug("String_Node_Str" + orStep + "String_Node_Str"+ (orStep >= 0 ? OperatingRound.stepNames[orStep] : "String_Node_Str"));
  if (oRound.getOperatingCompanyIndex() != orCompIndex) {
    if (orCompIndex >= 0)     orPanel.finishORCompanyTurn(orCompIndex);
    setORCompanyTurn(oRound.getOperatingCompanyIndex());
  }
  orPanel.initORCompanyTurn(orCompIndex);
  privatesCanBeBoughtNow=possibleActions.contains(BuyPrivate.class);
  orPanel.initPrivateBuying(privatesCanBeBoughtNow);
  if (possibleActions.contains(LayTile.class)) {
    orPanel.initTileLayingStep();
    orWindow.requestFocus();
    log.debug("String_Node_Str");
    mapRelatedActions.addAll(possibleActions.getType(LayTile.class));
  }
 else   if (possibleActions.contains(LayBaseToken.class)) {
    orWindow.requestFocus();
    List<LayToken> possibleTokenLays=possibleActions.getType(LayToken.class);
    mapRelatedActions.addAll(possibleTokenLays);
    allowedTokenLays=possibleTokenLays;
    orPanel.initTokenLayingStep();
    log.debug("String_Node_Str");
  }
 else   if (possibleActions.contains(SetDividend.class) && localStep == SELECT_PAYOUT) {
    SetDividend action;
    if (actionToComplete != null) {
      action=(SetDividend)actionToComplete;
    }
 else {
      action=possibleActions.getType(SetDividend.class).get(0);
    }
    log.debug("String_Node_Str" + action);
    orPanel.initPayoutStep(orCompIndex,action,action.isAllocationAllowed(SetDividend.WITHHOLD),action.isAllocationAllowed(SetDividend.SPLIT),action.isAllocationAllowed(SetDividend.PAYOUT));
    setMessage(LocalText.getText("String_Node_Str"));
  }
 else   if (possibleActions.contains(SetDividend.class)) {
    SetDividend action=possibleActions.getType(SetDividend.class).get(0);
    orPanel.initRevenueEntryStep(orCompIndex,action);
    String message=LocalText.getText("String_Node_Str");
    if (action.getRequiredCash() > 0) {
      message+="String_Node_Str" + LocalText.getText("String_Node_Str",Bank.format(action.getRequiredCash())) + "String_Node_Str";
    }
    setMessage(message);
  }
 else   if (possibleActions.contains(BuyTrain.class)) {
    orPanel.initTrainBuying(true);
    StringBuffer b=new StringBuffer(LocalText.getText("String_Node_Str"));
    for (    BuyTrain bTrain : possibleActions.getType(BuyTrain.class)) {
      if (bTrain.hasNoTrains()) {
        b.append("String_Node_Str");
        b.append(LocalText.getText("String_Node_Str"));
        b.append("String_Node_Str");
        break;
      }
    }
    setMessage(b.toString());
  }
 else   if (possibleActions.contains(DiscardTrain.class)) {
    gameUIManager.discardTrains(possibleActions.getType(DiscardTrain.class).get(0));
  }
 else   if (possibleActions.contains(RepayLoans.class)) {
    orPanel.enableLoanRepayment(possibleActions.getType(RepayLoans.class).get(0));
  }
 else   if (orStep == OperatingRound.STEP_FINAL) {
    orPanel.finishORCompanyTurn(orCompIndex);
  }
  if (possibleActions.contains(TakeLoans.class)) {
    orPanel.enableLoanTaking(possibleActions.getType(TakeLoans.class).get(0));
  }
  setMapRelatedActions(mapRelatedActions);
  GameAction undoAction=null;
  GameAction redoAction=null;
  if (possibleActions.contains(NullAction.class)) {
    List<NullAction> actions=possibleActions.getType(NullAction.class);
    for (    NullAction action : actions) {
switch (action.getMode()) {
case NullAction.DONE:
        orPanel.enableDone(action);
      break;
  }
}
}
if (possibleActions.contains(GameAction.class)) {
List<GameAction> actions=possibleActions.getType(GameAction.class);
for (GameAction action : actions) {
switch (action.getMode()) {
case GameAction.UNDO:
    undoAction=action;
  break;
case GameAction.REDO:
redoAction=action;
break;
}
}
}
orPanel.enableUndo(undoAction);
orPanel.enableRedo(redoAction);
orPanel.initSpecialActions();
if (possibleActions.contains(LayBonusToken.class) && !possibleActions.contains(LayBaseToken.class)) {
List<LayBonusToken> bonusTokenActions=possibleActions.getType(LayBonusToken.class);
for (LayBonusToken btAction : bonusTokenActions) {
SpecialTokenLay stl=btAction.getSpecialProperty();
BonusToken token=(BonusToken)stl.getToken();
String text=LocalText.getText("String_Node_Str",token.toString(),stl.getLocationCodeString());
orPanel.addSpecialAction(btAction,text);
}
}
if (possibleActions.contains(BuyBonusToken.class)) {
List<BuyBonusToken> bonusTokenActions=possibleActions.getType(BuyBonusToken.class);
for (BuyBonusToken bbt : bonusTokenActions) {
String text=LocalText.getText("String_Node_Str",bbt.getName(),Bank.format(bbt.getValue()),bbt.getSellerName(),Bank.format(bbt.getPrice()));
orPanel.addSpecialAction(bbt,text);
}
}
if (possibleActions.contains(ReachDestinations.class)) {
orPanel.addSpecialAction(possibleActions.getType(ReachDestinations.class).get(0),LocalText.getText("String_Node_Str"));
}
checkForGameSpecificActions();
orPanel.redisplay();
}

Fixed version (ground truth):
public void updateStatus(PossibleAction actionToComplete){
  mapRelatedActions.clear();
  orPanel.resetActions();
  if (actionToComplete != null) {
    log.debug("String_Node_Str" + actionToComplete);
  }
  orStep=oRound.getStep();
  orComp=oRound.getOperatingCompany();
  log.debug("String_Node_Str" + orCompIndex + "String_Node_Str"+ oRound.getRoundName());
  log.debug("String_Node_Str" + orComp.getName());
  log.debug("String_Node_Str" + orStep + "String_Node_Str"+ (orStep >= 0 ? OperatingRound.stepNames[orStep] : "String_Node_Str"));
  if (oRound.getOperatingCompanyIndex() != orCompIndex) {
    if (orCompIndex >= 0)     orPanel.finishORCompanyTurn(orCompIndex);
    setORCompanyTurn(oRound.getOperatingCompanyIndex());
  }
  orPanel.initORCompanyTurn(orCompIndex);
  privatesCanBeBoughtNow=possibleActions.contains(BuyPrivate.class);
  orPanel.initPrivateBuying(privatesCanBeBoughtNow);
  if (possibleActions.contains(LayTile.class)) {
    orPanel.initTileLayingStep();
    orWindow.requestFocus();
    log.debug("String_Node_Str");
    mapRelatedActions.addAll(possibleActions.getType(LayTile.class));
  }
 else   if (possibleActions.contains(LayBaseToken.class)) {
    orWindow.requestFocus();
    List<LayToken> possibleTokenLays=possibleActions.getType(LayToken.class);
    mapRelatedActions.addAll(possibleTokenLays);
    allowedTokenLays=possibleTokenLays;
    orPanel.initTokenLayingStep();
    log.debug("String_Node_Str");
  }
 else   if (possibleActions.contains(SetDividend.class) && localStep == SELECT_PAYOUT) {
    SetDividend action;
    if (actionToComplete != null) {
      action=(SetDividend)actionToComplete;
    }
 else {
      action=possibleActions.getType(SetDividend.class).get(0);
    }
    log.debug("String_Node_Str" + action);
    orPanel.initPayoutStep(orCompIndex,action,action.isAllocationAllowed(SetDividend.WITHHOLD),action.isAllocationAllowed(SetDividend.SPLIT),action.isAllocationAllowed(SetDividend.PAYOUT));
    setMessage(LocalText.getText("String_Node_Str"));
  }
 else   if (possibleActions.contains(SetDividend.class)) {
    SetDividend action=possibleActions.getType(SetDividend.class).get(0);
    orPanel.initRevenueEntryStep(orCompIndex,action);
    String message=LocalText.getText("String_Node_Str");
    if (action.getRequiredCash() > 0) {
      message+="String_Node_Str" + LocalText.getText("String_Node_Str",Bank.format(action.getRequiredCash())) + "String_Node_Str";
    }
    setMessage(message);
  }
 else   if (possibleActions.contains(BuyTrain.class)) {
    orPanel.initTrainBuying(true);
    StringBuffer b=new StringBuffer(LocalText.getText("String_Node_Str"));
    for (    BuyTrain bTrain : possibleActions.getType(BuyTrain.class)) {
      if (bTrain.hasNoTrains()) {
        b.append("String_Node_Str");
        b.append(LocalText.getText("String_Node_Str"));
        b.append("String_Node_Str");
        break;
      }
    }
    setMessage(b.toString());
  }
 else   if (possibleActions.contains(DiscardTrain.class)) {
    gameUIManager.discardTrains(possibleActions.getType(DiscardTrain.class).get(0));
  }
 else   if (possibleActions.contains(RepayLoans.class)) {
    orPanel.enableLoanRepayment(possibleActions.getType(RepayLoans.class).get(0));
  }
 else   if (orStep == OperatingRound.STEP_FINAL) {
    orPanel.finishORCompanyTurn(orCompIndex);
  }
  if (possibleActions.contains(TakeLoans.class)) {
    orPanel.enableLoanTaking(possibleActions.getType(TakeLoans.class).get(0));
  }
  setMapRelatedActions(mapRelatedActions);
  GameAction undoAction=null;
  GameAction redoAction=null;
  if (possibleActions.contains(NullAction.class)) {
    List<NullAction> actions=possibleActions.getType(NullAction.class);
    for (    NullAction action : actions) {
switch (action.getMode()) {
case NullAction.DONE:
        orPanel.enableDone(action);
      break;
  }
}
}
if (possibleActions.contains(GameAction.class)) {
List<GameAction> actions=possibleActions.getType(GameAction.class);
for (GameAction action : actions) {
switch (action.getMode()) {
case GameAction.UNDO:
    undoAction=action;
  break;
case GameAction.REDO:
redoAction=action;
break;
}
}
}
orPanel.enableUndo(undoAction);
orPanel.enableRedo(redoAction);
orPanel.initSpecialActions();
if (possibleActions.contains(LayBonusToken.class) && !possibleActions.contains(LayBaseToken.class)) {
List<LayBonusToken> bonusTokenActions=possibleActions.getType(LayBonusToken.class);
for (LayBonusToken btAction : bonusTokenActions) {
SpecialTokenLay stl=btAction.getSpecialProperty();
BonusToken token=(BonusToken)stl.getToken();
String text=LocalText.getText("String_Node_Str",token.toString(),stl.getLocationCodeString());
orPanel.addSpecialAction(btAction,text);
}
}
if (possibleActions.contains(BuyBonusToken.class)) {
List<BuyBonusToken> bonusTokenActions=possibleActions.getType(BuyBonusToken.class);
for (BuyBonusToken bbt : bonusTokenActions) {
String text=LocalText.getText("String_Node_Str",bbt.getName(),Bank.format(bbt.getValue()),bbt.getSellerName(),Bank.format(bbt.getPrice()));
orPanel.addSpecialAction(bbt,text);
}
}
if (possibleActions.contains(ReachDestinations.class)) {
orPanel.addSpecialAction(possibleActions.getType(ReachDestinations.class).get(0),LocalText.getText("String_Node_Str"));
}
checkForGameSpecificActions();
orPanel.redisplay();
}