Program: 173645
Project: 173645
Buggy source:
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();
    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;
        for (int i=1; i <= sale.getMaximumNumber(); i++) {
          options.add(LocalText.getText("String_Node_Str",i,sale.getShare(),i * sale.getShare(),sale.getCompanyName(),Bank.format(i * sale.getShareUnits() * sale.getPrice())));
          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);
        ((SellShares)chosenAction).setNumberSold(sellAmounts.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;
      PublicCertificateI cert;
      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();
        PublicCompanyI company=buy.getCompany();
        companyName=company.getName();
        sharePerCert=buy.getSharePerCertificate();
        shareUnit=company.getShareUnit();
        sharesPerCert=sharePerCert / shareUnit;
        if (buy instanceof StartCompany) {
          startCompany=true;
          int[] startPrices;
          if (((StartCompany)buy).mustSelectAPrice()) {
            startPrices=((StartCompany)buy).getStartPrices();
            Arrays.sort(startPrices);
            for (int i=0; i < startPrices.length; i++) {
              options.add(LocalText.getText("String_Node_Str",Bank.format(startPrices[i]),sharePerCert,Bank.format(sharesPerCert * startPrices[i])));
              buyActions.add(buy);
              buyAmounts.add(startPrices[i]);
            }
          }
 else {
            startPrices=new int[]{((StartCompany)buy).getPrice()};
            options.add(LocalText.getText("String_Node_Str",companyName,sharePerCert,Bank.format(startPrices[0])));
            buyActions.add(buy);
            buyAmounts.add(startPrices[0]);
          }
        }
 else {
          options.add(LocalText.getText("String_Node_Str",sharePerCert,companyName,buy.getFromPortfolio().getName(),Bank.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(),Bank.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,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str",playerName,companyName),options.toArray(new String[0]),-1);
          gameUIManager.setCurrentDialog(dialog,actions.get(0));
          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) {
        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):
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();
    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;
        for (int i=1; i <= sale.getMaximumNumber(); i++) {
          options.add(LocalText.getText("String_Node_Str",i,sale.getShare(),i * sale.getShare(),sale.getCompanyName(),Bank.format(i * sale.getShareUnits() * sale.getPrice())));
          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);
        ((SellShares)chosenAction).setNumberSold(sellAmounts.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;
      PublicCertificateI cert;
      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();
        PublicCompanyI company=buy.getCompany();
        companyName=company.getName();
        sharePerCert=buy.getSharePerCertificate();
        shareUnit=company.getShareUnit();
        sharesPerCert=sharePerCert / shareUnit;
        if (buy instanceof StartCompany) {
          startCompany=true;
          int[] startPrices;
          if (((StartCompany)buy).mustSelectAPrice()) {
            startPrices=((StartCompany)buy).getStartPrices();
            Arrays.sort(startPrices);
            if (startPrices.length > 1) {
              for (int i=0; i < startPrices.length; i++) {
                options.add(LocalText.getText("String_Node_Str",Bank.format(startPrices[i]),sharePerCert,Bank.format(sharesPerCert * startPrices[i])));
                buyActions.add(buy);
                buyAmounts.add(startPrices[i]);
              }
            }
 else {
              options.add(LocalText.getText("String_Node_Str",companyName,company.getPresidentsShare().getShare(),Bank.format(company.getPresidentsShare().getShares() * startPrices[0])));
              buyActions.add(buy);
              buyAmounts.add(startPrices[0]);
            }
          }
 else {
            startPrices=new int[]{((StartCompany)buy).getPrice()};
            options.add(LocalText.getText("String_Node_Str",companyName,sharePerCert,Bank.format(startPrices[0])));
            buyActions.add(buy);
            buyAmounts.add(startPrices[0]);
          }
        }
 else {
          options.add(LocalText.getText("String_Node_Str",sharePerCert,companyName,buy.getFromPortfolio().getName(),Bank.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(),Bank.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,LocalText.getText("String_Node_Str"),LocalText.getText("String_Node_Str",playerName,companyName),options.toArray(new String[0]),-1);
          gameUIManager.setCurrentDialog(dialog,actions.get(0));
          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) {
        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();
}