Program: 13060
Project: 13060
Buggy source:
/** 
 * Create the dialog.
 * @param connDetails from which the dialog will be filled
 */
public ConnectionDetailsDialog(final java.util.Map<String,ConnectionDetails> connDetails,boolean modal){
  this.setTitle("String_Node_Str");
  this.setModal(modal);
  this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  this.connDetails=connDetails;
  setBounds(100,100,450,300);
  getContentPane().setLayout(new BorderLayout());
  JPanel contentPanel=new JPanel();
  contentPanel.setBorder(new EmptyBorder(5,5,5,5));
  getContentPane().add(contentPanel,BorderLayout.CENTER);
  initListModel();
  contentPanel.setLayout(new BorderLayout(0,0));
  JPanel listPanel=new JPanel();
  JPanel tablePanel=new JPanel();
  JSplitPane splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,listPanel,tablePanel);
  getContentPane().add(splitPane,BorderLayout.CENTER);
  listPanel.setLayout(new BorderLayout(0,0));
  JPanel listButtonsPanel=new JPanel();
  listPanel.add(listButtonsPanel,BorderLayout.SOUTH);
  final JButton addListButton=new JButton("String_Node_Str");
  addListButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      String connectionName;
      do {
        connectionName=JOptionPane.showInputDialog("String_Node_Str");
        if (listModel.contains(connectionName)) {
          JOptionPane.showMessageDialog(ConnectionDetailsDialog.this,"String_Node_Str");
        }
      }
 while (listModel.contains(connectionName));
      int selectedIndex=list.getSelectedIndex();
      if (selectedIndex == -1) {
        listModel.addElement(connectionName);
      }
 else {
        listModel.insertElementAt(connectionName,selectedIndex + 1);
      }
      connDetails.put(connectionName,new ConnectionDetails());
    }
  }
);
  listButtonsPanel.add(addListButton);
  JButton removeListButton=new JButton("String_Node_Str");
  removeListButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int selectedIndex=list.getSelectedIndex();
      if (selectedIndex != -1) {
        listModel.remove(selectedIndex);
      }
    }
  }
);
  listButtonsPanel.add(removeListButton);
  list=new JList<String>(listModel);
  JScrollPane listScrollPane=new JScrollPane(list);
  listPanel.add(listScrollPane);
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  list.getSelectionModel().addListSelectionListener(this);
  tablePanel.setLayout(new BorderLayout(0,0));
  JPanel headerPanel=new JPanel();
  tablePanel.add(headerPanel,BorderLayout.NORTH);
  JLabel lblConnectionType=new JLabel("String_Node_Str");
  headerPanel.add(lblConnectionType);
  connTypeTextField=new JTextField();
  headerPanel.add(connTypeTextField);
  connTypeTextField.setColumns(10);
  connTypeTextField.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      String text=e.getActionCommand();
      ConnectionDetails connectionDetail=connDetails.get(selectedConnection);
      connectionDetail.setConnectionType(text);
    }
  }
);
  JPanel tableButtonsPanel=new JPanel();
  tablePanel.add(tableButtonsPanel,BorderLayout.SOUTH);
  JButton addTableButton=new JButton("String_Node_Str");
  addTableButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      tableModel.addRow(new String[]{"String_Node_Str","String_Node_Str"});
    }
  }
);
  tableButtonsPanel.add(addTableButton);
  JButton removeTableButton=new JButton("String_Node_Str");
  removeTableButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int selRow=table.getSelectedRow();
      tableModel.removeRow(selRow);
    }
  }
);
  tableButtonsPanel.add(removeTableButton);
  table=new JTable();
  JScrollPane tableScrollPane=new JScrollPane(table);
  tablePanel.add(tableScrollPane);
{
    JPanel buttonPane=new JPanel();
    buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
    getContentPane().add(buttonPane,BorderLayout.SOUTH);
{
      JButton okButton=new JButton("String_Node_Str");
      okButton.setActionCommand("String_Node_Str");
      buttonPane.add(okButton);
      getRootPane().setDefaultButton(okButton);
      okButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          option=JOptionPane.OK_OPTION;
          ConnectionDetailsDialog.this.setVisible(false);
        }
      }
);
    }
{
      JButton cancelButton=new JButton("String_Node_Str");
      cancelButton.setActionCommand("String_Node_Str");
      buttonPane.add(cancelButton);
      cancelButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          option=JOptionPane.CANCEL_OPTION;
          ConnectionDetailsDialog.this.setVisible(false);
        }
      }
);
    }
  }
  if (listModel.getSize() > 0) {
    list.setSelectedIndex(0);
    selectedConnection=listModel.get(0);
    updateConnDetails(connDetails.get(selectedConnection));
  }
}

Fixed version (ground truth):
/** 
 * Create the dialog.
 * @param connDetails from which the dialog will be filled
 */
public ConnectionDetailsDialog(final java.util.Map<String,ConnectionDetails> connDetails,boolean modal){
  this.setTitle("String_Node_Str");
  this.setModal(modal);
  this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  this.connDetails=connDetails;
  setBounds(100,100,450,300);
  getContentPane().setLayout(new BorderLayout());
  JPanel contentPanel=new JPanel();
  contentPanel.setBorder(new EmptyBorder(5,5,5,5));
  getContentPane().add(contentPanel,BorderLayout.CENTER);
  initListModel();
  contentPanel.setLayout(new BorderLayout(0,0));
  JPanel listPanel=new JPanel();
  JPanel tablePanel=new JPanel();
  JSplitPane splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,listPanel,tablePanel);
  getContentPane().add(splitPane,BorderLayout.CENTER);
  listPanel.setLayout(new BorderLayout(0,0));
  JPanel listButtonsPanel=new JPanel();
  listPanel.add(listButtonsPanel,BorderLayout.SOUTH);
  final JButton addListButton=new JButton("String_Node_Str");
  addListButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      String connectionName;
      do {
        connectionName=JOptionPane.showInputDialog("String_Node_Str");
        if (listModel.contains(connectionName)) {
          JOptionPane.showMessageDialog(ConnectionDetailsDialog.this,"String_Node_Str");
        }
      }
 while (listModel.contains(connectionName));
      int selectedIndex=list.getSelectedIndex();
      if (selectedIndex == -1) {
        listModel.addElement(connectionName);
      }
 else {
        listModel.insertElementAt(connectionName,selectedIndex + 1);
      }
      connDetails.put(connectionName,new ConnectionDetails());
    }
  }
);
  listButtonsPanel.add(addListButton);
  JButton removeListButton=new JButton("String_Node_Str");
  removeListButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int selectedIndex=list.getSelectedIndex();
      if (selectedIndex != -1) {
        listModel.remove(selectedIndex);
      }
    }
  }
);
  listButtonsPanel.add(removeListButton);
  list=new JList<String>(listModel);
  JScrollPane listScrollPane=new JScrollPane(list);
  listPanel.add(listScrollPane);
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  list.getSelectionModel().addListSelectionListener(this);
  tablePanel.setLayout(new BorderLayout(0,0));
  JPanel headerPanel=new JPanel();
  tablePanel.add(headerPanel,BorderLayout.NORTH);
  JLabel lblConnectionType=new JLabel("String_Node_Str");
  headerPanel.add(lblConnectionType);
  connTypeTextField=new JTextField();
  headerPanel.add(connTypeTextField);
  connTypeTextField.setColumns(10);
  connTypeTextField.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      String text=e.getActionCommand();
      ConnectionDetails connectionDetail=connDetails.get(selectedConnection);
      connectionDetail.setConnectionType(text);
    }
  }
);
  JPanel tableButtonsPanel=new JPanel();
  tablePanel.add(tableButtonsPanel,BorderLayout.SOUTH);
  JButton addTableButton=new JButton("String_Node_Str");
  addTableButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      tableModel.addRow(new String[]{"String_Node_Str","String_Node_Str"});
    }
  }
);
  tableButtonsPanel.add(addTableButton);
  JButton removeTableButton=new JButton("String_Node_Str");
  removeTableButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int selRow=table.getSelectedRow();
      tableModel.removeRow(selRow);
    }
  }
);
  tableButtonsPanel.add(removeTableButton);
  table=new JTable();
  table.putClientProperty("String_Node_Str",true);
  JScrollPane tableScrollPane=new JScrollPane(table);
  tablePanel.add(tableScrollPane);
{
    JPanel buttonPane=new JPanel();
    buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
    getContentPane().add(buttonPane,BorderLayout.SOUTH);
{
      JButton okButton=new JButton("String_Node_Str");
      okButton.setActionCommand("String_Node_Str");
      buttonPane.add(okButton);
      getRootPane().setDefaultButton(okButton);
      okButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          option=JOptionPane.OK_OPTION;
          ConnectionDetailsDialog.this.setVisible(false);
        }
      }
);
    }
{
      JButton cancelButton=new JButton("String_Node_Str");
      cancelButton.setActionCommand("String_Node_Str");
      buttonPane.add(cancelButton);
      cancelButton.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          option=JOptionPane.CANCEL_OPTION;
          ConnectionDetailsDialog.this.setVisible(false);
        }
      }
);
    }
  }
  if (listModel.getSize() > 0) {
    list.setSelectedIndex(0);
    selectedConnection=listModel.get(0);
    updateConnDetails(connDetails.get(selectedConnection));
  }
}