Program: 173419
Project: 173419
Buggy source:
@Override public void actionPerformed(ActionEvent actor){
  JComponent source=(JComponent)actor.getSource();
  List<PossibleAction> actions;
  PossibleAction chosenAction=null;
  if (source instanceof ClickField) {
    gbc=gb.getConstraints(source);
    actions=((ClickField)source).getPossibleActions();
    SoundManager.notifyOfClickFieldSelection(actions.get(0));
    log.debug("String_Node_Str" + actions.get(0).toString());
    if (actions == null || actions.size() == 0) {
      log.warn("String_Node_Str");
    }
 else     if (actions.get(0) instanceof SellShares) {
      List<String> options=new ArrayList<String>();
      List<SellShares> sellActions=new ArrayList<SellShares>();
      List<Integer> sellAmounts=new ArrayList<Integer>();
      SellShares sale;
      for (      PossibleAction action : actions) {
        sale=(SellShares)action;
        int i=sale.getNumber();
        if (sale.getPresidentExchange() == 0) {
          options.add(LocalText.getText("String_Node_Str",i,sale.getShare(),i * sale.getShare(),sale.getCompanyName(),gameUIManager.format(i * sale.getShareUnits() * sale.getPrice())));
        }
 else {
          options.add(LocalText.getText("String_Node_Str",i,sale.getShare(),i * sale.getShare(),sale.getCompanyName(),gameUIManager.format(i * sale.getShareUnits() * sale.getPrice()),3 - sale.getPresidentExchange(),sale.getPresidentExchange() * sale.getShareUnit()));
        }
        sellActions.add(sale);
        sellAmounts.add(i);
      }
      int index=0;
      if (options.size() > 1) {
        String message=LocalText.getText("String_Node_Str");
        String sp=(String)JOptionPane.showInputDialog(this,message,message,JOptionPane.QUESTION_MESSAGE,null,options.toArray(new String[0]),options.get(0));
        index=options.indexOf(sp);
      }
 else       if (options.size() == 1) {
        String message=LocalText.getText("String_Node_Str");
        int result=JOptionPane.showConfirmDialog(this,options.get(0),message,JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
        index=(result == JOptionPane.OK_OPTION ? 0 : -1);
      }
      if (index < 0) {
      }
 else {
        chosenAction=sellActions.get(index);
      }
    }
 else     if (actions.get(0) instanceof BuyCertificate) {
      boolean startCompany=false;
      List<String> options=new ArrayList<String>();
      List<BuyCertificate> buyActions=new ArrayList<BuyCertificate>();
      List<Integer> buyAmounts=new ArrayList<Integer>();
      BuyCertificate buy;
      String companyName="String_Node_Str";
      String playerName="String_Node_Str";
      int sharePerCert;
      int sharesPerCert;
      int shareUnit;
      for (      PossibleAction action : actions) {
        buy=(BuyCertificate)action;
        playerName=buy.getPlayerName();
        PublicCompany company=buy.getCompany();
        companyName=company.getId();
        sharePerCert=buy.getSharePerCertificate();
        shareUnit=company.getShareUnit();
        sharesPerCert=sharePerCert / shareUnit;
        if (buy instanceof StartCompany) {
          startCompany=true;
          int[] startPrices;
          if (((StartCompany_1880)buy).mustSelectAPrice()) {
            startPrices=((StartCompany_1880)buy).getStartPrices();
            Arrays.sort(startPrices);
            for (int i=0; i < startPrices.length; i++) {
              options.add("String_Node_Str" + startPrices[i]);
            }
          }
        }
 else {
          options.add(LocalText.getText("String_Node_Str",sharePerCert,companyName,buy.getFromPortfolio().getId(),gameUIManager.format(sharesPerCert * buy.getPrice())));
          buyActions.add(buy);
          buyAmounts.add(1);
          for (int i=2; i <= buy.getMaximumNumber(); i++) {
            options.add(LocalText.getText("String_Node_Str",i,sharePerCert,companyName,buy.getFromPortfolio().getId(),gameUIManager.format(i * sharesPerCert * buy.getPrice())));
            buyActions.add(buy);
            buyAmounts.add(i);
          }
        }
      }
      int index=0;
      if (options.size() > 1) {
        if (startCompany) {
          RadioButtonDialog dialog=new RadioButtonDialog(GameUIManager.COMPANY_START_PRICE_DIALOG,gameUIManager,parent,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str",playerName,companyName),options.toArray(new String[0]),0);
          gameUIManager.setCurrentDialog(dialog,actions.get(0));
          parent.disableButtons();
          return;
        }
 else {
          String sp=(String)JOptionPane.showInputDialog(this,LocalText.getText(startCompany ? "String_Node_Str" : "String_Node_Str"),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,options.toArray(new String[0]),options.get(0));
          index=options.indexOf(sp);
        }
      }
 else       if (options.size() == 1) {
        if (startCompany) {
          RadioButtonDialog dialog=new RadioButtonDialog(GameUIManager.COMPANY_START_PRICE_DIALOG,gameUIManager,parent,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str",playerName,companyName),options.toArray(new String[0]),0);
          gameUIManager.setCurrentDialog(dialog,actions.get(0));
          parent.disableButtons();
          return;
        }
 else {
          int result=JOptionPane.showConfirmDialog(this,options.get(0),LocalText.getText("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
          index=(result == JOptionPane.OK_OPTION ? 0 : -1);
        }
      }
      if (index < 0) {
      }
 else       if (startCompany) {
        chosenAction=buyActions.get(index);
        ((StartCompany)chosenAction).setStartPrice(buyAmounts.get(index));
        ((StartCompany)chosenAction).setNumberBought(((StartCompany)chosenAction).getSharesPerCertificate());
      }
 else {
        chosenAction=buyActions.get(index);
        ((BuyCertificate)chosenAction).setNumberBought(buyAmounts.get(index));
      }
    }
 else     if (actions.get(0) instanceof CashCorrectionAction) {
      CashCorrectionAction cca=(CashCorrectionAction)actions.get(0);
      String amountString=(String)JOptionPane.showInputDialog(this,LocalText.getText("String_Node_Str",cca.getCashHolderName()),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,null,0);
      if (amountString.substring(0,1).equals("String_Node_Str"))       amountString=amountString.substring(1);
      int amount;
      try {
        amount=Integer.parseInt(amountString);
      }
 catch (      NumberFormatException e) {
        amount=0;
      }
      cca.setAmount(amount);
      chosenAction=cca;
    }
 else {
      chosenAction=processGameSpecificActions(actor,actions.get(0));
    }
  }
 else {
    log.warn("String_Node_Str" + source.toString());
  }
  chosenAction=processGameSpecificFollowUpActions(actor,chosenAction);
  if (chosenAction != null)   (parent).process(chosenAction);
  repaint();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent actor){
  JComponent source=(JComponent)actor.getSource();
  List<PossibleAction> actions;
  PossibleAction chosenAction=null;
  if (source instanceof ClickField) {
    gbc=gb.getConstraints(source);
    actions=((ClickField)source).getPossibleActions();
    SoundManager.notifyOfClickFieldSelection(actions.get(0));
    log.debug("String_Node_Str" + actions.get(0).toString());
    if (actions == null || actions.size() == 0) {
      log.warn("String_Node_Str");
    }
 else     if (actions.get(0) instanceof SellShares) {
      List<String> options=new ArrayList<String>();
      List<SellShares> sellActions=new ArrayList<SellShares>();
      List<Integer> sellAmounts=new ArrayList<Integer>();
      SellShares sale;
      for (      PossibleAction action : actions) {
        sale=(SellShares)action;
        int i=sale.getNumber();
        if (sale.getPresidentExchange() == 0) {
          options.add(LocalText.getText("String_Node_Str",i,sale.getShare(),i * sale.getShare(),sale.getCompanyName(),gameUIManager.format(i * sale.getShareUnits() * sale.getPrice())));
        }
 else {
          options.add(LocalText.getText("String_Node_Str",i,sale.getShare(),i * sale.getShare(),sale.getCompanyName(),gameUIManager.format(i * sale.getShareUnits() * sale.getPrice()),3 - sale.getPresidentExchange(),sale.getPresidentExchange() * sale.getShareUnit()));
        }
        sellActions.add(sale);
        sellAmounts.add(i);
      }
      int index=0;
      if (options.size() > 1) {
        String message=LocalText.getText("String_Node_Str");
        String sp=(String)JOptionPane.showInputDialog(this,message,message,JOptionPane.QUESTION_MESSAGE,null,options.toArray(new String[0]),options.get(0));
        index=options.indexOf(sp);
      }
 else       if (options.size() == 1) {
        String message=LocalText.getText("String_Node_Str");
        int result=JOptionPane.showConfirmDialog(this,options.get(0),message,JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
        index=(result == JOptionPane.OK_OPTION ? 0 : -1);
      }
      if (index < 0) {
      }
 else {
        chosenAction=sellActions.get(index);
      }
    }
 else     if (actions.get(0) instanceof BuyCertificate) {
      boolean startCompany=false;
      List<String> options=new ArrayList<String>();
      List<BuyCertificate> buyActions=new ArrayList<BuyCertificate>();
      List<Integer> buyAmounts=new ArrayList<Integer>();
      BuyCertificate buy;
      String companyName="String_Node_Str";
      String playerName="String_Node_Str";
      int sharePerCert;
      int sharesPerCert;
      int shareUnit;
      for (      PossibleAction action : actions) {
        buy=(BuyCertificate)action;
        playerName=buy.getPlayerName();
        PublicCompany company=buy.getCompany();
        companyName=company.getId();
        sharePerCert=buy.getSharePerCertificate();
        shareUnit=company.getShareUnit();
        sharesPerCert=sharePerCert / shareUnit;
        if (buy instanceof StartCompany) {
          startCompany=true;
          int[] startPrices;
          if (((StartCompany_1880)buy).mustSelectAPrice()) {
            startPrices=((StartCompany_1880)buy).getStartPrices();
            Arrays.sort(startPrices);
            for (int i=0; i < startPrices.length; i++) {
              options.add("String_Node_Str" + startPrices[i]);
            }
          }
        }
 else {
          options.add(LocalText.getText("String_Node_Str",sharePerCert,companyName,buy.getFromPortfolio().getName(),gameUIManager.format(sharesPerCert * buy.getPrice())));
          buyActions.add(buy);
          buyAmounts.add(1);
          for (int i=2; i <= buy.getMaximumNumber(); i++) {
            options.add(LocalText.getText("String_Node_Str",i,sharePerCert,companyName,buy.getFromPortfolio().getName(),gameUIManager.format(i * sharesPerCert * buy.getPrice())));
            buyActions.add(buy);
            buyAmounts.add(i);
          }
        }
      }
      int index=0;
      if (options.size() > 1) {
        if (startCompany) {
          RadioButtonDialog dialog=new RadioButtonDialog(GameUIManager.COMPANY_START_PRICE_DIALOG,gameUIManager,parent,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str",playerName,companyName),options.toArray(new String[0]),0);
          gameUIManager.setCurrentDialog(dialog,actions.get(0));
          parent.disableButtons();
          return;
        }
 else {
          String sp=(String)JOptionPane.showInputDialog(this,LocalText.getText(startCompany ? "String_Node_Str" : "String_Node_Str"),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,options.toArray(new String[0]),options.get(0));
          index=options.indexOf(sp);
        }
      }
 else       if (options.size() == 1) {
        if (startCompany) {
          RadioButtonDialog dialog=new RadioButtonDialog(GameUIManager.COMPANY_START_PRICE_DIALOG,gameUIManager,parent,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str",playerName,companyName),options.toArray(new String[0]),0);
          gameUIManager.setCurrentDialog(dialog,actions.get(0));
          parent.disableButtons();
          return;
        }
 else {
          int result=JOptionPane.showConfirmDialog(this,options.get(0),LocalText.getText("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
          index=(result == JOptionPane.OK_OPTION ? 0 : -1);
        }
      }
      if (index < 0) {
      }
 else       if (startCompany) {
        chosenAction=buyActions.get(index);
        ((StartCompany)chosenAction).setStartPrice(buyAmounts.get(index));
        ((StartCompany)chosenAction).setNumberBought(((StartCompany)chosenAction).getSharesPerCertificate());
      }
 else {
        chosenAction=buyActions.get(index);
        ((BuyCertificate)chosenAction).setNumberBought(buyAmounts.get(index));
      }
    }
 else     if (actions.get(0) instanceof CashCorrectionAction) {
      CashCorrectionAction cca=(CashCorrectionAction)actions.get(0);
      String amountString=(String)JOptionPane.showInputDialog(this,LocalText.getText("String_Node_Str",cca.getCashHolderName()),LocalText.getText("String_Node_Str"),JOptionPane.QUESTION_MESSAGE,null,null,0);
      if (amountString.substring(0,1).equals("String_Node_Str"))       amountString=amountString.substring(1);
      int amount;
      try {
        amount=Integer.parseInt(amountString);
      }
 catch (      NumberFormatException e) {
        amount=0;
      }
      cca.setAmount(amount);
      chosenAction=cca;
    }
 else {
      chosenAction=processGameSpecificActions(actor,actions.get(0));
    }
  }
 else {
    log.warn("String_Node_Str" + source.toString());
  }
  chosenAction=processGameSpecificFollowUpActions(actor,chosenAction);
  if (chosenAction != null)   (parent).process(chosenAction);
  repaint();
}