Program: 49911
Project: 49911
Buggy source:
private void initComponents(boolean isPlayback) throws Exception {
  m_inCheckLabel=new JLabel("String_Node_Str");
  m_inCheckLabel.setHorizontalTextPosition(SwingConstants.CENTER);
  m_inCheckLabel.setForeground(Color.RED);
  m_undoButton=new JButton("String_Node_Str");
  m_undoButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (getGame().getHistory().size() == 0)       return;
      try {
        getGame().getHistory().get(getGame().getHistory().size() - 1).undo();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      getGame().getHistory().remove(getGame().getHistory().size() - 1);
      (getGame().isBlackMove() ? getGame().getBlackRules() : getGame().getWhiteRules()).undoEndOfGame();
      boardRefresh(getGame().getBoards());
    }
  }
);
  int twoBoardsGridBagOffset=0;
  if (m_optionsMenu == null || !m_optionsMenu.isVisible())   Driver.getInstance().setMenu(createMenuBar());
  Driver.m_gameOptionsMenu.setVisible(!isPlayback);
  setLayout(new GridBagLayout());
  GridBagConstraints constraints=new GridBagConstraints();
  final Board[] boards=getGame().getBoards();
  setBorder(BorderFactory.createLoweredBevelBorder());
  m_inCheckLabel.setHorizontalTextPosition(SwingConstants.CENTER);
  m_inCheckLabel.setHorizontalAlignment(SwingConstants.CENTER);
  constraints.fill=GridBagConstraints.NONE;
  constraints.gridy=0;
  constraints.gridx=9;
  m_inCheckLabel.setVisible(false);
  add(m_inCheckLabel,constraints);
  if (boards.length == 1) {
    constraints.gridheight=12;
    constraints.gridy=2;
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.gridwidth=10;
    constraints.gridheight=10;
    constraints.insets=new Insets(10,0,0,0);
    constraints.gridx=0;
    add(createGrid(boards[0],isPlayback,false),constraints);
  }
 else {
    constraints.gridheight=12;
    constraints.gridy=2;
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.gridwidth=10;
    constraints.insets=new Insets(10,0,0,0);
    constraints.gridx=0;
    add(createGrid(boards[0],isPlayback,false),constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.gridwidth=10;
    constraints.insets=new Insets(10,0,0,0);
    constraints.gridx=11;
    add(createGrid(boards[1],isPlayback,false),constraints);
    twoBoardsGridBagOffset+=10;
  }
  JButton nextButton=new JButton("String_Node_Str");
  nextButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (m_historyIndex + 1 == m_history.length)       return;
      try {
        m_history[++m_historyIndex].execute();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  JButton prevButton=new JButton("String_Node_Str");
  prevButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (m_historyIndex == -1)       return;
      try {
        m_history[m_historyIndex--].undo();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  m_whiteLabel=new JLabel("String_Node_Str");
  m_whiteLabel.setHorizontalAlignment(SwingConstants.CENTER);
  m_whiteLabel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_blackLabel=new JLabel("String_Node_Str");
  m_blackLabel.setHorizontalAlignment(SwingConstants.CENTER);
  m_blackLabel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_whiteLabel.setOpaque(true);
  m_blackLabel.setOpaque(true);
  m_whiteLabel.setVisible(true);
  m_blackLabel.setVisible(true);
  int jailBoardSize;
  if (getGame().getWhiteTeam().size() <= 4 && getGame().getBlackTeam().size() <= 4) {
    jailBoardSize=4;
  }
 else {
    double size=getGame().getWhiteTeam().size() > getGame().getBlackTeam().size() ? Math.sqrt(getGame().getWhiteTeam().size()) : Math.sqrt(getGame().getBlackTeam().size());
    jailBoardSize=(int)Math.ceil(size);
  }
  m_whiteCapturesJail=new Board(jailBoardSize,jailBoardSize,false);
  m_whiteCapturePanel=createGrid(m_whiteCapturesJail,isPlayback,true);
  m_whiteCapturePanel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_whiteCapturePanel.setLayout(new GridLayout(jailBoardSize,jailBoardSize));
  m_whiteCapturePanel.setPreferredSize(new Dimension((m_whiteCapturesJail.getMaxCol() + 1) * 25,(m_whiteCapturesJail.getMaxRow() + 1) * 25));
  m_blackCapturesJail=new Board(jailBoardSize,jailBoardSize,false);
  m_blackCapturePanel=createGrid(m_blackCapturesJail,isPlayback,true);
  m_blackCapturePanel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_blackCapturePanel.setLayout(new GridLayout(jailBoardSize,jailBoardSize));
  m_blackCapturePanel.setPreferredSize(new Dimension((m_blackCapturesJail.getMaxCol() + 1) * 25,(m_blackCapturesJail.getMaxRow() + 1) * 25));
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.gridheight=1;
  constraints.insets=new Insets(10,10,10,0);
  constraints.ipadx=100;
  constraints.gridx=11 + twoBoardsGridBagOffset;
  constraints.gridy=0;
  add(m_blackLabel,constraints);
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.gridheight=3;
  constraints.ipadx=0;
  constraints.insets=new Insets(0,25,10,25);
  constraints.gridx=11 + twoBoardsGridBagOffset;
  constraints.gridy=1;
  add(m_blackCapturePanel,constraints);
  if (!isPlayback) {
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=4;
    add(m_blackTimer.getDisplayLabel(),constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=5;
    add(m_undoButton,constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=6;
    add(m_whiteTimer.getDisplayLabel(),constraints);
  }
 else {
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=4;
    add(nextButton,constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=5;
    add(prevButton,constraints);
  }
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.gridheight=3;
  constraints.ipadx=0;
  constraints.gridx=11 + twoBoardsGridBagOffset;
  if (m_whiteTimer instanceof NoTimer) {
    constraints.gridy=6;
    constraints.insets=new Insets(10,25,0,25);
  }
 else {
    constraints.gridy=7;
    constraints.insets=new Insets(0,25,0,25);
  }
  add(m_whiteCapturePanel,constraints);
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.weightx=0.0;
  constraints.weighty=0.0;
  constraints.insets=new Insets(10,0,10,0);
  if (m_whiteTimer instanceof NoTimer) {
    constraints.gridheight=1;
    constraints.gridy=9;
  }
 else {
    constraints.gridheight=2;
    constraints.gridy=11;
  }
  constraints.ipadx=100;
  constraints.gridx=11 + twoBoardsGridBagOffset;
  add(m_whiteLabel,constraints);
  Dimension dimension=Toolkit.getDefaultToolkit().getScreenSize();
  int x=(int)((dimension.getWidth() / 3.3));
  int y=(int)((dimension.getHeight() / 4));
  Driver.getInstance().setLocation(x,y);
}

Fixed version (ground truth):
private void initComponents(boolean isPlayback) throws Exception {
  m_inCheckLabel=new JLabel("String_Node_Str");
  m_inCheckLabel.setHorizontalTextPosition(SwingConstants.CENTER);
  m_inCheckLabel.setForeground(Color.RED);
  m_undoButton=new JButton("String_Node_Str");
  m_undoButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (getGame().getHistory().size() == 0)       return;
      try {
        getGame().getHistory().get(getGame().getHistory().size() - 1).undo();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      getGame().getHistory().remove(getGame().getHistory().size() - 1);
      (getGame().isBlackMove() ? getGame().getBlackRules() : getGame().getWhiteRules()).undoEndOfGame();
      boardRefresh(getGame().getBoards());
    }
  }
);
  int twoBoardsGridBagOffset=0;
  if (m_optionsMenu == null || !m_optionsMenu.isVisible())   Driver.getInstance().setMenu(createMenuBar());
  Driver.m_gameOptionsMenu.setVisible(!isPlayback);
  setLayout(new GridBagLayout());
  GridBagConstraints constraints=new GridBagConstraints();
  final Board[] boards=getGame().getBoards();
  setBorder(BorderFactory.createLoweredBevelBorder());
  m_inCheckLabel.setHorizontalTextPosition(SwingConstants.CENTER);
  m_inCheckLabel.setHorizontalAlignment(SwingConstants.CENTER);
  constraints.fill=GridBagConstraints.NONE;
  constraints.gridy=0;
  constraints.gridx=9;
  m_inCheckLabel.setVisible(false);
  add(m_inCheckLabel,constraints);
  if (boards.length == 1) {
    constraints.gridheight=12;
    constraints.gridy=2;
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.gridwidth=10;
    constraints.gridheight=10;
    constraints.insets=new Insets(10,0,0,0);
    constraints.gridx=0;
    add(createGrid(boards[0],isPlayback,false),constraints);
  }
 else {
    constraints.gridheight=12;
    constraints.gridy=2;
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.gridwidth=10;
    constraints.insets=new Insets(10,0,0,0);
    constraints.gridx=0;
    add(createGrid(boards[0],isPlayback,false),constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.gridwidth=10;
    constraints.insets=new Insets(10,0,0,0);
    constraints.gridx=11;
    add(createGrid(boards[1],isPlayback,false),constraints);
    twoBoardsGridBagOffset+=10;
  }
  JButton nextButton=new JButton("String_Node_Str");
  nextButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (m_historyIndex + 1 == m_history.length)       return;
      try {
        m_history[++m_historyIndex].execute();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  JButton prevButton=new JButton("String_Node_Str");
  prevButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      if (m_historyIndex == -1)       return;
      try {
        m_history[m_historyIndex--].undo();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  m_whiteLabel=new JLabel("String_Node_Str");
  m_whiteLabel.setHorizontalAlignment(SwingConstants.CENTER);
  m_whiteLabel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_blackLabel=new JLabel("String_Node_Str");
  m_blackLabel.setHorizontalAlignment(SwingConstants.CENTER);
  m_blackLabel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_whiteLabel.setOpaque(true);
  m_blackLabel.setOpaque(true);
  m_whiteLabel.setVisible(true);
  m_blackLabel.setVisible(true);
  int jailBoardSize;
  if (getGame().getWhiteTeam().size() <= 4 && getGame().getBlackTeam().size() <= 4) {
    jailBoardSize=4;
  }
 else {
    double size=getGame().getWhiteTeam().size() > getGame().getBlackTeam().size() ? Math.sqrt(getGame().getWhiteTeam().size()) : Math.sqrt(getGame().getBlackTeam().size());
    jailBoardSize=(int)Math.ceil(size);
  }
  m_whiteCapturesJail=new Board(jailBoardSize,jailBoardSize,false);
  m_whiteCapturePanel=createGrid(m_whiteCapturesJail,isPlayback,true);
  m_whiteCapturePanel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_whiteCapturePanel.setLayout(new GridLayout(jailBoardSize,jailBoardSize));
  m_whiteCapturePanel.setPreferredSize(new Dimension((m_whiteCapturesJail.getMaxCol() + 1) * 25,(m_whiteCapturesJail.getMaxRow() + 1) * 25));
  m_blackCapturesJail=new Board(jailBoardSize,jailBoardSize,false);
  m_blackCapturePanel=createGrid(m_blackCapturesJail,isPlayback,true);
  m_blackCapturePanel.setBorder(BorderFactory.createTitledBorder("String_Node_Str"));
  m_blackCapturePanel.setLayout(new GridLayout(jailBoardSize,jailBoardSize));
  m_blackCapturePanel.setPreferredSize(new Dimension((m_blackCapturesJail.getMaxCol() + 1) * 25,(m_blackCapturesJail.getMaxRow() + 1) * 25));
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.gridheight=1;
  constraints.insets=new Insets(10,10,10,0);
  constraints.ipadx=100;
  constraints.gridx=11 + twoBoardsGridBagOffset;
  constraints.gridy=0;
  add(m_blackLabel,constraints);
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.gridheight=3;
  constraints.ipadx=0;
  constraints.insets=new Insets(0,25,10,25);
  constraints.gridx=11 + twoBoardsGridBagOffset;
  constraints.gridy=1;
  add(m_blackCapturePanel,constraints);
  if (!isPlayback) {
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=4;
    add(m_blackTimer.getDisplayLabel(),constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=5;
    add(m_undoButton,constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=6;
    add(m_whiteTimer.getDisplayLabel(),constraints);
  }
 else {
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=4;
    add(nextButton,constraints);
    constraints.fill=GridBagConstraints.HORIZONTAL;
    constraints.anchor=GridBagConstraints.BASELINE;
    constraints.gridwidth=3;
    constraints.gridheight=1;
    constraints.ipadx=100;
    constraints.gridx=11 + twoBoardsGridBagOffset;
    constraints.gridy=5;
    add(prevButton,constraints);
  }
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.gridheight=3;
  constraints.ipadx=0;
  constraints.gridx=11 + twoBoardsGridBagOffset;
  if (m_whiteTimer instanceof NoTimer) {
    constraints.gridy=6;
    constraints.insets=new Insets(10,25,0,25);
  }
 else {
    constraints.gridy=7;
    constraints.insets=new Insets(0,25,0,25);
  }
  add(m_whiteCapturePanel,constraints);
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.gridwidth=3;
  constraints.weightx=0.0;
  constraints.weighty=0.0;
  constraints.insets=new Insets(10,0,10,0);
  if (m_whiteTimer instanceof NoTimer) {
    constraints.gridheight=1;
    constraints.gridy=9;
  }
 else {
    constraints.gridheight=2;
    constraints.gridy=11;
  }
  constraints.ipadx=100;
  constraints.gridx=11 + twoBoardsGridBagOffset;
  add(m_whiteLabel,constraints);
}