Program: 159813
Project: 159813
Buggy source:
/** 
 * Creates new form TablesPanel 
 */
public TablesPanel(){
  tableModel=new TableTableModel();
  matchesModel=new MatchesTableModel();
  gameChooser=new GameChooser();
  initComponents();
  tableModel.setSession(session);
  chkShowCompleted.setVisible(false);
  tableTables.createDefaultColumnsFromModel();
  chatPanel.useExtendedView(ChatPanel.VIEW_MODE.NONE);
  chatPanel.setBorder(null);
  JComponent[] components=new JComponent[]{chatPanel,jSplitPane1,jScrollPane1,jScrollPane2,jPanel1,jPanel3};
  for (  JComponent component : components) {
    component.setOpaque(false);
  }
  jScrollPane1.getViewport().setBackground(new Color(255,255,255,50));
  jScrollPane2.getViewport().setBackground(new Color(255,255,255,50));
  Action joinTable=new AbstractAction(){
    @Override public void actionPerformed(    ActionEvent e){
      int modelRow=Integer.valueOf(e.getActionCommand());
      UUID tableId=(UUID)tableModel.getValueAt(modelRow,9);
      UUID gameId=(UUID)tableModel.getValueAt(modelRow,8);
      String state=(String)tableModel.getValueAt(modelRow,6);
      boolean isTournament=(Boolean)tableModel.getValueAt(modelRow,7);
      String owner=(String)tableModel.getValueAt(modelRow,1);
      if (state.equals("String_Node_Str")) {
        if (owner.equals(session.getUserName())) {
          try {
            JDesktopPane desktopPane=(JDesktopPane)MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE);
            JInternalFrame[] windows=desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER);
            for (            JInternalFrame frame : windows) {
              if (frame.getTitle().equals("String_Node_Str")) {
                frame.toFront();
                frame.setVisible(true);
                try {
                  frame.setSelected(true);
                }
 catch (                PropertyVetoException ve) {
                  ve.printStackTrace();
                  logger.error(ve);
                }
              }
            }
          }
 catch (          Exception ex) {
            logger.error(ex);
          }
          return;
        }
        if (isTournament) {
          logger.info("String_Node_Str" + tableId);
          session.joinTournamentTable(roomId,tableId,session.getUserName(),"String_Node_Str",1);
        }
 else {
          logger.info("String_Node_Str" + tableId);
          joinTableDialog.showDialog(roomId,tableId);
        }
      }
 else       if (state.equals("String_Node_Str")) {
        session.removeTable(roomId,tableId);
      }
 else       if (state.equals("String_Node_Str")) {
        logger.info("String_Node_Str" + tableId);
        session.watchTable(roomId,tableId);
      }
 else       if (state.equals("String_Node_Str")) {
        logger.info("String_Node_Str" + gameId);
        session.replayGame(gameId);
      }
    }
  }
;
  Action replayMatch=new AbstractAction(){
    @Override public void actionPerformed(    ActionEvent e){
      int modelRow=Integer.valueOf(e.getActionCommand());
      List<UUID> games=(List<UUID>)matchesModel.getValueAt(modelRow,6);
      if (games.size() == 1) {
        session.replayGame(games.get(0));
      }
 else {
        gameChooser.show(games,MageFrame.getDesktop().getMousePosition());
      }
    }
  }
;
  new ButtonColumn(tableTables,joinTable,6);
  new ButtonColumn(tableCompleted,replayMatch,5);
}

Fixed version (ground truth):
/** 
 * Creates new form TablesPanel 
 */
public TablesPanel(){
  tableModel=new TableTableModel();
  matchesModel=new MatchesTableModel();
  gameChooser=new GameChooser();
  initComponents();
  tableModel.setSession(session);
  chkShowCompleted.setVisible(false);
  tableTables.createDefaultColumnsFromModel();
  chatPanel.useExtendedView(ChatPanel.VIEW_MODE.NONE);
  chatPanel.setBorder(null);
  JComponent[] components=new JComponent[]{chatPanel,jSplitPane1,jScrollPane1,jScrollPane2,jPanel1,jPanel3};
  for (  JComponent component : components) {
    component.setOpaque(false);
  }
  jScrollPane1.getViewport().setBackground(new Color(255,255,255,50));
  jScrollPane2.getViewport().setBackground(new Color(255,255,255,50));
  Action joinTable=new AbstractAction(){
    @Override public void actionPerformed(    ActionEvent e){
      int modelRow=Integer.valueOf(e.getActionCommand());
      UUID tableId=(UUID)tableModel.getValueAt(modelRow,9);
      UUID gameId=(UUID)tableModel.getValueAt(modelRow,8);
      String state=(String)tableModel.getValueAt(modelRow,6);
      boolean isTournament=(Boolean)tableModel.getValueAt(modelRow,7);
      String owner=(String)tableModel.getValueAt(modelRow,1);
      if (state.equals("String_Node_Str")) {
        if (owner.equals(session.getUserName())) {
          try {
            JDesktopPane desktopPane=(JDesktopPane)MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE);
            JInternalFrame[] windows=desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER);
            for (            JInternalFrame frame : windows) {
              if (frame.getTitle().equals("String_Node_Str")) {
                frame.toFront();
                frame.setVisible(true);
                try {
                  frame.setSelected(true);
                }
 catch (                PropertyVetoException ve) {
                  ve.printStackTrace();
                  logger.error(ve);
                }
              }
            }
          }
 catch (          Exception ex) {
            logger.error(ex);
          }
          return;
        }
        if (isTournament) {
          logger.info("String_Node_Str" + tableId);
          session.joinTournamentTable(roomId,tableId,session.getUserName(),"String_Node_Str",1);
        }
 else {
          logger.info("String_Node_Str" + tableId);
          joinTableDialog.showDialog(roomId,tableId);
        }
      }
 else       if (state.equals("String_Node_Str")) {
        if (JOptionPane.showConfirmDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
          session.removeTable(roomId,tableId);
        }
      }
 else       if (state.equals("String_Node_Str")) {
        logger.info("String_Node_Str" + tableId);
        session.watchTable(roomId,tableId);
      }
 else       if (state.equals("String_Node_Str")) {
        logger.info("String_Node_Str" + gameId);
        session.replayGame(gameId);
      }
    }
  }
;
  Action replayMatch=new AbstractAction(){
    @Override public void actionPerformed(    ActionEvent e){
      int modelRow=Integer.valueOf(e.getActionCommand());
      List<UUID> games=(List<UUID>)matchesModel.getValueAt(modelRow,6);
      if (games.size() == 1) {
        session.replayGame(games.get(0));
      }
 else {
        gameChooser.show(games,MageFrame.getDesktop().getMousePosition());
      }
    }
  }
;
  new ButtonColumn(tableTables,joinTable,6);
  new ButtonColumn(tableCompleted,replayMatch,5);
}