Program: 75187
Project: 75187
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));
  _portTable.addMouseListener(new MouseAdapter(){
    public void mouseClicked(    MouseEvent mouseEvent){
      if ((VergilUtilities.macOSLookAndFeel() && (mouseEvent.isPopupTrigger() || (mouseEvent.getButton() == MouseEvent.BUTTON1 && ((mouseEvent.getModifiersEx() | java.awt.event.InputEvent.CTRL_DOWN_MASK) == java.awt.event.InputEvent.CTRL_DOWN_MASK)))) || (!VergilUtilities.macOSLookAndFeel() && mouseEvent.getButton() == MouseEvent.BUTTON3)) {
        Point point=mouseEvent.getPoint();
        int row=_portTable.rowAtPoint(point);
        _setSelectedRow(row);
      }
    }
  }
);
  _portTable.addKeyListener(new KeyAdapter(){
    public void keyTyped(    KeyEvent ke){
      if (ke.getKeyChar() == '\n') {
        _apply();
        _cancel();
      }
    }
  }
);
  _initColumnNames();
  _setupTableModel();
  _initColumnSizes();
  setScrollableContents(_portTable);
  _jth=_portTable.getTableHeader();
  if (_columnNames.contains(ColumnNames.COL_SHOW_NAME) || _columnNames.contains(ColumnNames.COL_HIDE)) {
    _jth.addMouseListener(new MouseAdapter(){
      public void mouseClicked(      MouseEvent me){
        int showName=_columnNames.indexOf(ColumnNames.COL_SHOW_NAME);
        if (showName != -1) {
          Rectangle headerShowNameRect=_jth.getHeaderRect(showName);
          if (headerShowNameRect.contains(me.getPoint())) {
            _portTableModel.toggleShowAllNames();
          }
        }
        int hide=_columnNames.indexOf(ColumnNames.COL_HIDE);
        if (hide != 1) {
          Rectangle headerHidePortRect=_jth.getHeaderRect(hide);
          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));
  _portTable.addMouseListener(new MouseAdapter(){
    public void mouseClicked(    MouseEvent mouseEvent){
      if ((VergilUtilities.macOSLookAndFeel() && (mouseEvent.isPopupTrigger() || (mouseEvent.getButton() == MouseEvent.BUTTON1 && ((mouseEvent.getModifiersEx() | java.awt.event.InputEvent.CTRL_MASK) == java.awt.event.InputEvent.CTRL_MASK)))) || (!VergilUtilities.macOSLookAndFeel() && mouseEvent.getButton() == MouseEvent.BUTTON3)) {
        Point point=mouseEvent.getPoint();
        int row=_portTable.rowAtPoint(point);
        _setSelectedRow(row);
      }
    }
  }
);
  _portTable.addKeyListener(new KeyAdapter(){
    public void keyTyped(    KeyEvent ke){
      if (ke.getKeyChar() == '\n') {
        _apply();
        _cancel();
      }
    }
  }
);
  _initColumnNames();
  _setupTableModel();
  _initColumnSizes();
  setScrollableContents(_portTable);
  _jth=_portTable.getTableHeader();
  if (_columnNames.contains(ColumnNames.COL_SHOW_NAME) || _columnNames.contains(ColumnNames.COL_HIDE)) {
    _jth.addMouseListener(new MouseAdapter(){
      public void mouseClicked(      MouseEvent me){
        int showName=_columnNames.indexOf(ColumnNames.COL_SHOW_NAME);
        if (showName != -1) {
          Rectangle headerShowNameRect=_jth.getHeaderRect(showName);
          if (headerShowNameRect.contains(me.getPoint())) {
            _portTableModel.toggleShowAllNames();
          }
        }
        int hide=_columnNames.indexOf(ColumnNames.COL_HIDE);
        if (hide != 1) {
          Rectangle headerHidePortRect=_jth.getHeaderRect(hide);
          if (headerHidePortRect.contains(me.getPoint())) {
            _portTableModel.toggleHidePorts();
          }
        }
      }
    }
);
  }
  pack();
  setVisible(true);
}