Program: 49907
Project: 49907
Buggy source:
private JButton createContinueGameButton(){
  JButton continueGameButton=new JButton(Messages.getString("String_Node_Str"));
  continueGameButton.setToolTipText(Messages.getString("String_Node_Str"));
  continueGameButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      String[] files=FileUtility.getGamesInProgressFileArray();
      if (files.length == 0) {
        JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
        return;
      }
      final JFrame poppedFrame=new JFrame(Messages.getString("String_Node_Str"));
      poppedFrame.setLayout(new GridBagLayout());
      poppedFrame.setSize(225,200);
      poppedFrame.setResizable(false);
      poppedFrame.setLocationRelativeTo(Driver.this);
      GridBagConstraints constraints=new GridBagConstraints();
      final JList gamesInProgressList=new JList(FileUtility.getGamesInProgressFileArray());
      final JScrollPane scrollPane=new JScrollPane(gamesInProgressList);
      scrollPane.setPreferredSize(new Dimension(200,200));
      gamesInProgressList.setSelectedIndex(0);
      JButton nextButton=new JButton(Messages.getString("String_Node_Str"));
      nextButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent event){
          FileInputStream fileInputStream;
          ObjectInputStream objectInputStream;
          Game gameToPlay;
          try {
            if (gamesInProgressList.getSelectedValue() == null) {
              JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
              return;
            }
            fileInputStream=new FileInputStream(FileUtility.getGamesInProgressFile(gamesInProgressList.getSelectedValue().toString()));
            objectInputStream=new ObjectInputStream(fileInputStream);
            gameToPlay=(Game)objectInputStream.readObject();
            gameToPlay.getWhiteRules().setGame(gameToPlay);
            gameToPlay.getBlackRules().setGame(gameToPlay);
            if (mOptionsMenu != null)             mOptionsMenu.setVisible(true);
            setPanel(new PlayGamePanel(gameToPlay,false));
            poppedFrame.dispose();
          }
 catch (          Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
          }
        }
      }
);
      JButton cancelButton=new JButton(Messages.getString("String_Node_Str"));
      GuiUtility.setupCancelButton(cancelButton,poppedFrame);
      JButton deleteButton=new JButton(Messages.getString("String_Node_Str"));
      deleteButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent event){
          if (gamesInProgressList.getSelectedValue() != null) {
            boolean didDeleteSuccessfully=FileUtility.getGamesInProgressFile(gamesInProgressList.getSelectedValue().toString()).delete();
            if (!didDeleteSuccessfully) {
              JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
            }
 else {
              gamesInProgressList.setListData(FileUtility.getGamesInProgressFileArray());
              gamesInProgressList.setSelectedIndex(0);
              if (gamesInProgressList.getSelectedValue() == null) {
                JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
                poppedFrame.dispose();
              }
              scrollPane.getViewport().add(gamesInProgressList,null);
            }
          }
 else {
            JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
          }
        }
      }
);
      constraints.gridx=0;
      constraints.gridy=0;
      constraints.gridwidth=2;
      constraints.insets=new Insets(5,5,5,5);
      poppedFrame.add(scrollPane,constraints);
      constraints.gridx=0;
      constraints.gridy=1;
      poppedFrame.add(deleteButton,constraints);
      constraints.weighty=1.0;
      constraints.weightx=1.0;
      constraints.gridx=0;
      constraints.gridy=2;
      constraints.gridwidth=1;
      constraints.anchor=GridBagConstraints.EAST;
      poppedFrame.add(nextButton,constraints);
      constraints.gridx=1;
      constraints.gridy=2;
      constraints.anchor=GridBagConstraints.WEST;
      poppedFrame.add(cancelButton,constraints);
      poppedFrame.setVisible(true);
      poppedFrame.pack();
    }
  }
);
  return continueGameButton;
}

Fixed version (ground truth):
private JButton createContinueGameButton(){
  JButton continueGameButton=new JButton(Messages.getString("String_Node_Str"));
  continueGameButton.setToolTipText(Messages.getString("String_Node_Str"));
  try {
    continueGameButton.setIcon(GuiUtility.createImageIcon(30,30,FileUtility.getImagePath("String_Node_Str",true)));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  continueGameButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      String[] files=FileUtility.getGamesInProgressFileArray();
      if (files.length == 0) {
        JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
        return;
      }
      final JFrame poppedFrame=new JFrame(Messages.getString("String_Node_Str"));
      poppedFrame.setLayout(new GridBagLayout());
      poppedFrame.setSize(225,200);
      poppedFrame.setResizable(false);
      poppedFrame.setLocationRelativeTo(Driver.this);
      GridBagConstraints constraints=new GridBagConstraints();
      final JList gamesInProgressList=new JList(FileUtility.getGamesInProgressFileArray());
      final JScrollPane scrollPane=new JScrollPane(gamesInProgressList);
      scrollPane.setPreferredSize(new Dimension(200,200));
      gamesInProgressList.setSelectedIndex(0);
      JButton nextButton=new JButton(Messages.getString("String_Node_Str"));
      nextButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent event){
          FileInputStream fileInputStream;
          ObjectInputStream objectInputStream;
          Game gameToPlay;
          try {
            if (gamesInProgressList.getSelectedValue() == null) {
              JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
              return;
            }
            fileInputStream=new FileInputStream(FileUtility.getGamesInProgressFile(gamesInProgressList.getSelectedValue().toString()));
            objectInputStream=new ObjectInputStream(fileInputStream);
            gameToPlay=(Game)objectInputStream.readObject();
            gameToPlay.getWhiteRules().setGame(gameToPlay);
            gameToPlay.getBlackRules().setGame(gameToPlay);
            if (mOptionsMenu != null)             mOptionsMenu.setVisible(true);
            setPanel(new PlayGamePanel(gameToPlay,false));
            poppedFrame.dispose();
          }
 catch (          Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
          }
        }
      }
);
      JButton cancelButton=new JButton(Messages.getString("String_Node_Str"));
      GuiUtility.setupCancelButton(cancelButton,poppedFrame);
      JButton deleteButton=new JButton(Messages.getString("String_Node_Str"));
      deleteButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent event){
          if (gamesInProgressList.getSelectedValue() != null) {
            boolean didDeleteSuccessfully=FileUtility.getGamesInProgressFile(gamesInProgressList.getSelectedValue().toString()).delete();
            if (!didDeleteSuccessfully) {
              JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.ERROR_MESSAGE);
            }
 else {
              gamesInProgressList.setListData(FileUtility.getGamesInProgressFileArray());
              gamesInProgressList.setSelectedIndex(0);
              if (gamesInProgressList.getSelectedValue() == null) {
                JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
                poppedFrame.dispose();
              }
              scrollPane.getViewport().add(gamesInProgressList,null);
            }
          }
 else {
            JOptionPane.showMessageDialog(Driver.getInstance(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),JOptionPane.PLAIN_MESSAGE);
          }
        }
      }
);
      constraints.gridx=0;
      constraints.gridy=0;
      constraints.gridwidth=2;
      constraints.insets=new Insets(5,5,5,5);
      poppedFrame.add(scrollPane,constraints);
      constraints.gridx=0;
      constraints.gridy=1;
      poppedFrame.add(deleteButton,constraints);
      constraints.weighty=1.0;
      constraints.weightx=1.0;
      constraints.gridx=0;
      constraints.gridy=2;
      constraints.gridwidth=1;
      constraints.anchor=GridBagConstraints.EAST;
      poppedFrame.add(nextButton,constraints);
      constraints.gridx=1;
      constraints.gridy=2;
      constraints.anchor=GridBagConstraints.WEST;
      poppedFrame.add(cancelButton,constraints);
      poppedFrame.setVisible(true);
      poppedFrame.pack();
    }
  }
);
  return continueGameButton;
}