Program: 173552
Project: 173552
Buggy source:
public void actionPerformed(ActionEvent arg0){
  if (arg0.getSource().equals(newButton)) {
    startNewGame();
  }
 else   if (arg0.getSource().equals(optionButton)) {
    toggleOptions();
    this.pack();
  }
 else   if (arg0.getSource().equals(configureButton)) {
    if (configWindow == null) {
      configWindow=new ConfigWindow(false);
      configWindow.init();
      configWindow.setVisible(true);
    }
 else {
      configWindow.setVisible(true);
    }
  }
 else   if (arg0.getSource().equals(loadButton)) {
    String saveDirectory=Config.get("String_Node_Str");
    JFileChooser jfc=new JFileChooser();
    jfc.setCurrentDirectory(new File(saveDirectory));
    if (jfc.showOpenDialog(getContentPane()) == JFileChooser.APPROVE_OPTION) {
      File selectedFile=jfc.getSelectedFile();
      loadAndStartGame(selectedFile.getPath(),selectedFile.getParent());
    }
 else {
      return;
    }
  }
 else   if (arg0.getSource().equals(recentButton)) {
    File saveDirectory=new File(Config.get("String_Node_Str"));
    recentFiles=new TreeSet<File>(new Comparator<File>(){
      public int compare(      File a,      File b){
        return Math.round(b.lastModified() - a.lastModified());
      }
    }
);
    savedFileExtension=Config.get("String_Node_Str");
    if (!Util.hasValue(savedFileExtension)) {
      savedFileExtension=GameUIManager.DEFAULT_SAVE_EXTENSION;
    }
    savedFileExtension="String_Node_Str" + savedFileExtension;
    getRecentFiles(saveDirectory);
    if (recentFiles == null || recentFiles.size() == 0)     return;
    File[] files=recentFiles.toArray(new File[]{});
    int numOptions=20;
    String[] options=new String[numOptions];
    int dirPathLength=saveDirectory.getPath().length();
    for (int i=0; i < numOptions; i++) {
      options[i]=files[i].getPath().substring(dirPathLength + 1);
    }
    String text=LocalText.getText("String_Node_Str");
    String result=(String)JOptionPane.showInputDialog(this,text,text,JOptionPane.OK_CANCEL_OPTION,null,options,options[0]);
    if (result == null)     return;
    File selectedFile=files[Arrays.asList(options).indexOf(result)];
    if (selectedFile != null) {
      loadAndStartGame(selectedFile.getPath(),selectedFile.getParent());
    }
 else {
      return;
    }
  }
 else   if (arg0.getSource().equals(recoveryButton)) {
    String filePath=Config.get("String_Node_Str","String_Node_Str");
    loadAndStartGame(filePath,null);
  }
 else   if (arg0.getSource().equals(infoButton)) {
    GameInfo gameInfo=this.getSelectedGameInfo();
    JOptionPane.showMessageDialog(this,gameInfo.getDescription(),"String_Node_Str" + gameInfo.getName(),JOptionPane.INFORMATION_MESSAGE);
  }
 else   if (arg0.getSource().equals(quitButton)) {
    System.exit(0);
  }
 else   if (arg0.getSource().equals(creditsButton)) {
    JOptionPane.showMessageDialog(this,credits,LocalText.getText("String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
 else   if (arg0.getSource().equals(gameNameBox)) {
    fillPlayersPane();
    if (optionsPane.isVisible()) {
      toggleOptions();
      toggleOptions();
    }
    this.pack();
  }
 else   if (arg0.getSource() instanceof JComboBox) {
    JComboBox comboBox=(JComboBox)arg0.getSource();
    String[] boxName=comboBox.getName().split("String_Node_Str");
    if (boxName[0].equalsIgnoreCase("String_Node_Str")) {
switch (comboBox.getSelectedIndex()) {
case NONE_PLAYER:
        playerNameFields[Integer.parseInt(boxName[1])].setText("String_Node_Str");
      playerNameFields[Integer.parseInt(boxName[1])].setEnabled(false);
    break;
case HUMAN_PLAYER:
  playerNameFields[Integer.parseInt(boxName[1])].setEnabled(true);
break;
case AI_PLAYER:
playerNameFields[Integer.parseInt(boxName[1])].setText("String_Node_Str");
playerNameFields[Integer.parseInt(boxName[1])].setEnabled(false);
break;
}
}
}
 else if (arg0.getSource().equals(randomizeButton)) {
if (playerNameFields.length > 0) {
List<String> playerList=new ArrayList<String>();
for (int i=0; i < playerNameFields.length; i++) {
if (playerNameFields[i] != null && playerNameFields[i].getText().length() > 0) {
playerList.add(playerNameFields[i].getText());
playerNameFields[i].setText("String_Node_Str");
}
}
Collections.shuffle(playerList);
for (int i=0; i < playerList.size(); i++) {
playerNameFields[i].setText(playerList.get(i));
}
}
}
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent arg0){
  if (arg0.getSource().equals(newButton)) {
    startNewGame();
  }
 else   if (arg0.getSource().equals(optionButton)) {
    toggleOptions();
    this.pack();
  }
 else   if (arg0.getSource().equals(configureButton)) {
    if (configWindow == null) {
      configWindow=new ConfigWindow(false);
      configWindow.init();
      configWindow.setVisible(true);
    }
 else {
      configWindow.setVisible(true);
    }
  }
 else   if (arg0.getSource().equals(loadButton)) {
    String saveDirectory=Config.get("String_Node_Str");
    JFileChooser jfc=new JFileChooser();
    jfc.setCurrentDirectory(new File(saveDirectory));
    if (jfc.showOpenDialog(getContentPane()) == JFileChooser.APPROVE_OPTION) {
      File selectedFile=jfc.getSelectedFile();
      loadAndStartGame(selectedFile.getPath(),selectedFile.getParent());
    }
 else {
      return;
    }
  }
 else   if (arg0.getSource().equals(recentButton)) {
    File saveDirectory=new File(Config.get("String_Node_Str"));
    recentFiles=new TreeSet<File>(new Comparator<File>(){
      public int compare(      File a,      File b){
        return Math.round(b.lastModified() - a.lastModified());
      }
    }
);
    savedFileExtension=Config.get("String_Node_Str");
    if (!Util.hasValue(savedFileExtension)) {
      savedFileExtension=GameUIManager.DEFAULT_SAVE_EXTENSION;
    }
    savedFileExtension="String_Node_Str" + savedFileExtension;
    getRecentFiles(saveDirectory);
    if (recentFiles == null || recentFiles.size() == 0)     return;
    File[] files=recentFiles.toArray(new File[]{});
    int numOptions=20;
    numOptions=Math.min(numOptions,recentFiles.size());
    String[] options=new String[numOptions];
    int dirPathLength=saveDirectory.getPath().length();
    for (int i=0; i < numOptions; i++) {
      options[i]=files[i].getPath().substring(dirPathLength + 1);
    }
    String text=LocalText.getText("String_Node_Str");
    String result=(String)JOptionPane.showInputDialog(this,text,text,JOptionPane.OK_CANCEL_OPTION,null,options,options[0]);
    if (result == null)     return;
    File selectedFile=files[Arrays.asList(options).indexOf(result)];
    if (selectedFile != null) {
      loadAndStartGame(selectedFile.getPath(),selectedFile.getParent());
    }
 else {
      return;
    }
  }
 else   if (arg0.getSource().equals(recoveryButton)) {
    String filePath=Config.get("String_Node_Str","String_Node_Str");
    loadAndStartGame(filePath,null);
  }
 else   if (arg0.getSource().equals(infoButton)) {
    GameInfo gameInfo=this.getSelectedGameInfo();
    JOptionPane.showMessageDialog(this,gameInfo.getDescription(),"String_Node_Str" + gameInfo.getName(),JOptionPane.INFORMATION_MESSAGE);
  }
 else   if (arg0.getSource().equals(quitButton)) {
    System.exit(0);
  }
 else   if (arg0.getSource().equals(creditsButton)) {
    JOptionPane.showMessageDialog(this,credits,LocalText.getText("String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
 else   if (arg0.getSource().equals(gameNameBox)) {
    fillPlayersPane();
    if (optionsPane.isVisible()) {
      toggleOptions();
      toggleOptions();
    }
    this.pack();
  }
 else   if (arg0.getSource() instanceof JComboBox) {
    JComboBox comboBox=(JComboBox)arg0.getSource();
    String[] boxName=comboBox.getName().split("String_Node_Str");
    if (boxName[0].equalsIgnoreCase("String_Node_Str")) {
switch (comboBox.getSelectedIndex()) {
case NONE_PLAYER:
        playerNameFields[Integer.parseInt(boxName[1])].setText("String_Node_Str");
      playerNameFields[Integer.parseInt(boxName[1])].setEnabled(false);
    break;
case HUMAN_PLAYER:
  playerNameFields[Integer.parseInt(boxName[1])].setEnabled(true);
break;
case AI_PLAYER:
playerNameFields[Integer.parseInt(boxName[1])].setText("String_Node_Str");
playerNameFields[Integer.parseInt(boxName[1])].setEnabled(false);
break;
}
}
}
 else if (arg0.getSource().equals(randomizeButton)) {
if (playerNameFields.length > 0) {
List<String> playerList=new ArrayList<String>();
for (int i=0; i < playerNameFields.length; i++) {
if (playerNameFields[i] != null && playerNameFields[i].getText().length() > 0) {
playerList.add(playerNameFields[i].getText());
playerNameFields[i].setText("String_Node_Str");
}
}
Collections.shuffle(playerList);
for (int i=0; i < playerList.size(); i++) {
playerNameFields[i].setText(playerList.get(i));
}
}
}
}