Program: 75333
Project: 75333
Buggy source:
/** 
 * Construct a dialog that presents the ports as a table. Each row of the table corresponds to one port. The user modifies the table to specify changes in the ports. When the apply button is pressed the contents of the table is used to update the ports. When Commit is pressed an apply is done before exiting. <p> This dialog is is not modal. In particular, changes can be undone by clicking Edit->Undo, and the help screen can be manipulated while this dialog exists. The dialog is placed relative to the owner.
 * @param tableau The DialogTableau.
 * @param owner The object that, per the user, appears to be generating thedialog.
 * @param target The object whose ports are being configured.
 * @param configuration The configuration to use to open the help screen(or null if help is not supported).
 */
public PortConfigurerDialog(DialogTableau tableau,Frame owner,Entity target,Configuration configuration){
  super("String_Node_Str" + target.getName(),tableau,owner,target,configuration);
  getTarget().addChangeListener(this);
  _portLocationComboBox=new JComboBox();
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portTable=new JTable();
  _portTable.setPreferredScrollableViewportSize(new Dimension(600,70));
  ListSelectionModel rowSM=_portTable.getSelectionModel();
  rowSM.addListSelectionListener(_rowSelectionListener);
  _setupTableModel();
  _initColumnSizes();
  setScrollableContents(_portTable);
  _jth=_portTable.getTableHeader();
  _jth.addMouseListener(new MouseAdapter(){
    public void mouseClicked(    MouseEvent me){
      Rectangle headerShowNameRect=_jth.getHeaderRect(PortTableModel.COL_SHOW_NAME);
      Rectangle headerHidePortRect=_jth.getHeaderRect(PortTableModel.COL_HIDE);
      if (headerShowNameRect.contains(me.getPoint())) {
        _portTableModel.toggleShowAllNames();
      }
      if (headerHidePortRect.contains(me.getPoint())) {
        _portTableModel.toggleHidePorts();
      }
    }
  }
);
  pack();
  setVisible(true);
}

Fixed version (ground truth):
/** 
 * Construct a dialog that presents the ports as a table. Each row of the table corresponds to one port. The user modifies the table to specify changes in the ports. When the apply button is pressed the contents of the table is used to update the ports. When Commit is pressed an apply is done before exiting. <p> This dialog is is not modal. In particular, changes can be undone by clicking Edit->Undo, and the help screen can be manipulated while this dialog exists. The dialog is placed relative to the owner.
 * @param tableau The DialogTableau.
 * @param owner The object that, per the user, appears to be generating thedialog.
 * @param target The object whose ports are being configured.
 * @param configuration The configuration to use to open the help screen(or null if help is not supported).
 */
public PortConfigurerDialog(DialogTableau tableau,Frame owner,Entity target,Configuration configuration){
  super("String_Node_Str" + target.getName(),tableau,owner,target,configuration);
  getTarget().addChangeListener(this);
  _portLocationComboBox=new JComboBox();
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portLocationComboBox.addItem("String_Node_Str");
  _portTable=new JTable();
  _portTable.setPreferredScrollableViewportSize(new Dimension(600,70));
  ListSelectionModel rowSM=_portTable.getSelectionModel();
  rowSM.addListSelectionListener(_rowSelectionListener);
  _portTable.addMouseListener(new MouseAdapter(){
    public void mouseClicked(    MouseEvent me){
      if (me.getButton() == MouseEvent.BUTTON3) {
        Point point=me.getPoint();
        int row=_portTable.rowAtPoint(point);
        _setSelectedRow(row);
      }
    }
  }
);
  _setupTableModel();
  _initColumnSizes();
  setScrollableContents(_portTable);
  _jth=_portTable.getTableHeader();
  _jth.addMouseListener(new MouseAdapter(){
    public void mouseClicked(    MouseEvent me){
      Rectangle headerShowNameRect=_jth.getHeaderRect(PortTableModel.COL_SHOW_NAME);
      Rectangle headerHidePortRect=_jth.getHeaderRect(PortTableModel.COL_HIDE);
      if (headerShowNameRect.contains(me.getPoint())) {
        _portTableModel.toggleShowAllNames();
      }
      if (headerHidePortRect.contains(me.getPoint())) {
        _portTableModel.toggleHidePorts();
      }
    }
  }
);
  pack();
  setVisible(true);
}