Program: 49937
Project: 49937
Buggy source:
/** 
 * Initialize components of the GUI Create all the GUI components, set their specific properties and add them to the  window. Also add any necessary ActionListeners.
 */
public void initComponents(){
  setLayout(new GridBagLayout());
  GridBagConstraints c=new GridBagConstraints();
  humanPlay=new JButton("String_Node_Str");
  humanPlay.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      if (!clicked) {
        clicked=true;
        setupPopup(false);
      }
    }
  }
);
  networkPlay=new JButton("String_Node_Str");
  networkPlay.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      final JFrame pop=new JFrame("String_Node_Str");
      pop.setLayout(new FlowLayout());
      pop.setSize(350,150);
      pop.setResizable(false);
      pop.setLocationRelativeTo(null);
      JPanel options=new JPanel();
      final JLabel label=new JLabel("String_Node_Str");
      final JButton client=new JButton("String_Node_Str");
      client.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent arg0){
          final JFrame popped=new JFrame("String_Node_Str");
          popped.setLayout(new GridBagLayout());
          popped.setSize(370,150);
          popped.setResizable(false);
          popped.setLocationRelativeTo(null);
          GridBagConstraints c=new GridBagConstraints();
          final JLabel hoster=new JLabel("String_Node_Str");
          final JTextField computer=new JTextField("String_Node_Str",2);
          final JButton save=new JButton("String_Node_Str");
          save.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent e){
              if (computer.getText().equals("String_Node_Str")) {
                JOptionPane.showMessageDialog(null,"String_Node_Str");
                return;
              }
 else               if (computer.getText().length() < 2) {
                try {
                  int hostNumber=Integer.parseInt(computer.getText());
                  if (hostNumber > 25 || hostNumber < 1)                   throw new Exception();
                  host="String_Node_Str" + hostNumber;
                }
 catch (                Exception ne) {
                  JOptionPane.showMessageDialog(null,"String_Node_Str");
                  return;
                }
              }
 else {
                try {
                  int hostNumber=Integer.parseInt(computer.getText());
                  if (hostNumber > 25 || hostNumber < 1)                   throw new Exception();
                  host="String_Node_Str" + hostNumber;
                }
 catch (                Exception ne) {
                  JOptionPane.showMessageDialog(null,"String_Node_Str");
                  return;
                }
              }
              NewGameMenu.cancelled=false;
              Thread client;
              try {
                client=new Thread(new Runnable(){
                  @Override public void run(){
                    try {
                      new NetworkClient().join(host);
                    }
 catch (                    Exception e) {
                      e.printStackTrace();
                    }
                  }
                }
);
                client.start();
                Driver.getInstance().setPanel(new NetLoading(client));
              }
 catch (              Exception e1) {
                e1.printStackTrace();
              }
              popped.dispose();
              pop.dispose();
            }
          }
);
          final JButton back=new JButton("String_Node_Str");
          back.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent arg0){
              popped.dispose();
            }
          }
);
          JPanel everything=new JPanel();
          everything.setLayout(new GridBagLayout());
          c.gridx=0;
          c.gridy=0;
          c.gridwidth=2;
          c.insets=new Insets(3,3,3,3);
          popped.add(hoster,c);
          c.gridx=0;
          c.gridy=1;
          c.gridwidth=1;
          everything.add(new JLabel("String_Node_Str"),c);
          c.gridx=1;
          c.gridy=1;
          c.gridwidth=1;
          everything.add(computer,c);
          c.gridx=0;
          c.gridy=2;
          c.gridwidth=1;
          everything.add(back,c);
          c.gridx=1;
          c.gridy=2;
          c.gridwidth=1;
          everything.add(save,c);
          c.gridx=0;
          c.gridy=1;
          c.gridwidth=2;
          popped.add(everything,c);
          popped.setVisible(true);
        }
      }
);
      final JButton host=new JButton("String_Node_Str");
      host.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent arg0){
          setupPopup(true);
          pop.dispose();
        }
      }
);
      options.add(label);
      pop.add(options);
      pop.add(host);
      pop.add(client);
      pop.setVisible(true);
    }
  }
);
  AIPlay=new JButton("String_Node_Str");
  AIPlay.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      final JFrame popped=new JFrame("String_Node_Str");
      popped.setLayout(new GridBagLayout());
      popped.setSize(225,150);
      popped.setResizable(false);
      popped.setLocationRelativeTo(null);
      GridBagConstraints c=new GridBagConstraints();
      final JComboBox dropdown=new JComboBox(Builder.getArray());
      c.gridx=0;
      c.gridy=0;
      popped.add(new JLabel("String_Node_Str"),c);
      c.gridx=1;
      c.gridy=0;
      c.insets=new Insets(3,0,3,0);
      popped.add(dropdown,c);
      c.gridx=0;
      c.gridy=1;
      popped.add(new JLabel("String_Node_Str"),c);
      File dir=new File("String_Node_Str");
      dir.mkdir();
      String[] allFiles=dir.list();
      List<String> tempFiles=new ArrayList<String>();
      for (      String st : allFiles)       if (st.endsWith("String_Node_Str"))       tempFiles.add(st);
      String[] files=new String[tempFiles.size()];
      tempFiles.toArray(files);
      if (files.length == 0) {
        JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
        return;
      }
      final JComboBox ai=new JComboBox(files);
      c.gridx=1;
      c.gridy=1;
      c.fill=GridBagConstraints.HORIZONTAL;
      popped.add(ai,c);
      JButton next=new JButton("String_Node_Str");
      next.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent arg0){
          final String choice=(String)ai.getSelectedItem();
          File file=new File("String_Node_Str" + choice);
          if (ai.getSelectedItem() == null) {
            JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
            return;
          }
          Game toPlay=Builder.newGame((String)dropdown.getSelectedItem());
          JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
          StandardJavaFileManager fileManager=compiler.getStandardFileManager(null,Locale.getDefault(),null);
          String[] compileOptions=new String[]{"String_Node_Str","String_Node_Str"};
          Iterable<String> compilationOptions=Arrays.asList(compileOptions);
          List<File> sourceFileList=new ArrayList<File>();
          sourceFileList.add(file);
          Iterable<? extends JavaFileObject> compilationUnits=fileManager.getJavaFileObjectsFromFiles(sourceFileList);
          CompilationTask task=compiler.getTask(null,fileManager,null,compilationOptions,null,compilationUnits);
          boolean result=task.call();
          if (result) {
            System.out.println("String_Node_Str");
          }
 else {
            System.out.println("String_Node_Str");
            System.out.println("String_Node_Str");
            System.out.println("String_Node_Str");
            System.out.println("String_Node_Str");
            System.out.println("String_Node_Str");
            return;
          }
          try {
            fileManager.close();
          }
 catch (          IOException e) {
          }
          final AIPlugin plugin;
          final AIAdapter ai=new AIAdapter(toPlay);
          try {
            ClassLoader c=ClassLoader.getSystemClassLoader();
            Class<?> klazz=c.loadClass(choice.substring(0,choice.indexOf("String_Node_Str")));
            Constructor<?> construct=klazz.getConstructor();
            plugin=(AIPlugin)construct.newInstance();
            Thread aiThread;
            aiThread=new Thread(new Runnable(){
              @Override public void run(){
                try {
                  ai.runGame(plugin);
                }
 catch (                Exception e) {
                  e.printStackTrace();
                }
              }
            }
);
            aiThread.start();
          }
 catch (          Exception e1) {
            e1.printStackTrace();
          }
          try {
            PlayNetGame png=new PlayNetGame(toPlay,false,false);
            png.setAIGame(true);
            Driver.getInstance().setPanel(png);
          }
 catch (          Exception e) {
            return;
          }
          popped.dispose();
        }
      }
);
      JButton back=new JButton("String_Node_Str");
      back.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          popped.dispose();
        }
      }
);
      JPanel buttons=new JPanel();
      buttons.setLayout(new FlowLayout());
      buttons.add(back);
      buttons.add(next);
      c.gridx=0;
      c.gridy=2;
      c.gridwidth=2;
      popped.add(buttons,c);
      popped.setVisible(true);
    }
  }
);
  backButton=new JButton("String_Node_Str");
  backButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      Driver.getInstance().helpMenu.setText("String_Node_Str");
      Driver.getInstance().gamePlayHelp.setVisible(false);
      Driver.getInstance().revertPanel();
    }
  }
);
  try {
    if (InetAddress.getLocalHost().getHostName().contains("String_Node_Str")) {
      c.gridx=0;
      c.gridy=0;
      c.fill=GridBagConstraints.HORIZONTAL;
      c.insets=new Insets(5,5,0,0);
      add(humanPlay,c);
      c.gridx=1;
      c.gridy=0;
      c.fill=GridBagConstraints.HORIZONTAL;
      c.insets=new Insets(5,5,0,5);
      add(networkPlay,c);
      c.gridx=0;
      c.gridy=1;
      c.gridwidth=2;
      c.insets=new Insets(0,5,20,5);
      c.fill=GridBagConstraints.HORIZONTAL;
      add(AIPlay,c);
      c.gridx=0;
      c.gridy=2;
      add(backButton,c);
    }
 else {
      c.gridx=0;
      c.gridy=0;
      c.fill=GridBagConstraints.HORIZONTAL;
      c.insets=new Insets(5,5,0,5);
      add(humanPlay,c);
      c.gridx=0;
      c.gridy=1;
      c.insets=new Insets(0,5,20,5);
      c.fill=GridBagConstraints.HORIZONTAL;
      add(AIPlay,c);
      c.gridx=0;
      c.gridy=2;
      add(backButton,c);
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * Initialize components of the GUI Create all the GUI components, set their specific properties and add them to the  window. Also add any necessary ActionListeners.
 */
public void initComponents(){
  setLayout(new GridBagLayout());
  GridBagConstraints c=new GridBagConstraints();
  humanPlay=new JButton("String_Node_Str");
  humanPlay.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      if (!clicked) {
        clicked=true;
        setupPopup(false);
      }
    }
  }
);
  networkPlay=new JButton("String_Node_Str");
  networkPlay.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent arg0){
      final JFrame pop=new JFrame("String_Node_Str");
      pop.setLayout(new FlowLayout());
      pop.setSize(350,150);
      pop.setResizable(false);
      pop.setLocationRelativeTo(null);
      JPanel options=new JPanel();
      final JLabel label=new JLabel("String_Node_Str");
      final JButton client=new JButton("String_Node_Str");
      client.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent arg0){
          final JFrame popped=new JFrame("String_Node_Str");
          popped.setLayout(new GridBagLayout());
          popped.setSize(370,150);
          popped.setResizable(false);
          popped.setLocationRelativeTo(null);
          GridBagConstraints c=new GridBagConstraints();
          final JLabel hoster=new JLabel("String_Node_Str");
          final JTextField computer=new JTextField("String_Node_Str",2);
          final JButton save=new JButton("String_Node_Str");
          save.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent e){
              if (computer.getText().equals("String_Node_Str")) {
                JOptionPane.showMessageDialog(null,"String_Node_Str");
                return;
              }
 else               if (computer.getText().length() < 2) {
                try {
                  int hostNumber=Integer.parseInt(computer.getText());
                  if (hostNumber > 25 || hostNumber < 1)                   throw new Exception();
                  host="String_Node_Str" + hostNumber;
                }
 catch (                Exception ne) {
                  JOptionPane.showMessageDialog(null,"String_Node_Str");
                  return;
                }
              }
 else {
                try {
                  int hostNumber=Integer.parseInt(computer.getText());
                  if (hostNumber > 25 || hostNumber < 1)                   throw new Exception();
                  host="String_Node_Str" + hostNumber;
                }
 catch (                Exception ne) {
                  JOptionPane.showMessageDialog(null,"String_Node_Str");
                  return;
                }
              }
              NewGameMenu.cancelled=false;
              Thread client;
              try {
                client=new Thread(new Runnable(){
                  @Override public void run(){
                    try {
                      new NetworkClient().join(host);
                    }
 catch (                    Exception e) {
                      e.printStackTrace();
                    }
                  }
                }
);
                client.start();
                Driver.getInstance().setPanel(new NetLoading(client));
              }
 catch (              Exception e1) {
                e1.printStackTrace();
              }
              popped.dispose();
              pop.dispose();
            }
          }
);
          final JButton back=new JButton("String_Node_Str");
          back.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent arg0){
              popped.dispose();
            }
          }
);
          JPanel everything=new JPanel();
          everything.setLayout(new GridBagLayout());
          c.gridx=0;
          c.gridy=0;
          c.gridwidth=2;
          c.insets=new Insets(3,3,3,3);
          popped.add(hoster,c);
          c.gridx=0;
          c.gridy=1;
          c.gridwidth=1;
          everything.add(new JLabel("String_Node_Str"),c);
          c.gridx=1;
          c.gridy=1;
          c.gridwidth=1;
          everything.add(computer,c);
          c.gridx=0;
          c.gridy=2;
          c.gridwidth=1;
          everything.add(back,c);
          c.gridx=1;
          c.gridy=2;
          c.gridwidth=1;
          everything.add(save,c);
          c.gridx=0;
          c.gridy=1;
          c.gridwidth=2;
          popped.add(everything,c);
          popped.setVisible(true);
        }
      }
);
      final JButton host=new JButton("String_Node_Str");
      host.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent arg0){
          setupPopup(true);
          pop.dispose();
        }
      }
);
      options.add(label);
      pop.add(options);
      pop.add(host);
      pop.add(client);
      pop.setVisible(true);
    }
  }
);
  AIPlay=new JButton("String_Node_Str");
  AIPlay.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      final JFrame popped=new JFrame("String_Node_Str");
      popped.setLayout(new GridBagLayout());
      popped.setSize(225,150);
      popped.setResizable(false);
      popped.setLocationRelativeTo(null);
      GridBagConstraints c=new GridBagConstraints();
      final JComboBox dropdown=new JComboBox(Builder.getArray());
      c.gridx=0;
      c.gridy=0;
      popped.add(new JLabel("String_Node_Str"),c);
      c.gridx=1;
      c.gridy=0;
      c.insets=new Insets(3,0,3,0);
      popped.add(dropdown,c);
      c.gridx=0;
      c.gridy=1;
      popped.add(new JLabel("String_Node_Str"),c);
      File dir=new File("String_Node_Str");
      dir.mkdir();
      String[] allFiles=dir.list();
      List<String> tempFiles=new ArrayList<String>();
      for (      String st : allFiles)       if (st.endsWith("String_Node_Str"))       tempFiles.add(st);
      String[] files=new String[tempFiles.size()];
      tempFiles.toArray(files);
      if (files.length == 0) {
        JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
        return;
      }
      final JComboBox ai=new JComboBox(files);
      c.gridx=1;
      c.gridy=1;
      c.fill=GridBagConstraints.HORIZONTAL;
      popped.add(ai,c);
      JButton next=new JButton("String_Node_Str");
      next.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent arg0){
          final String choice=(String)ai.getSelectedItem();
          File file=new File("String_Node_Str" + choice);
          if (ai.getSelectedItem() == null) {
            JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
            return;
          }
          Game toPlay=Builder.newGame((String)dropdown.getSelectedItem());
          JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
          StandardJavaFileManager fileManager=compiler.getStandardFileManager(null,Locale.getDefault(),null);
          String[] compileOptions=new String[]{"String_Node_Str","String_Node_Str"};
          Iterable<String> compilationOptions=Arrays.asList(compileOptions);
          List<File> sourceFileList=new ArrayList<File>();
          sourceFileList.add(file);
          Iterable<? extends JavaFileObject> compilationUnits=fileManager.getJavaFileObjectsFromFiles(sourceFileList);
          CompilationTask task=compiler.getTask(null,fileManager,null,compilationOptions,null,compilationUnits);
          boolean result=task.call();
          if (!result) {
            JOptionPane.showMessageDialog(null,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
            return;
          }
          try {
            fileManager.close();
          }
 catch (          IOException e) {
          }
          final AIPlugin plugin;
          final AIAdapter ai=new AIAdapter(toPlay);
          try {
            ClassLoader c=ClassLoader.getSystemClassLoader();
            Class<?> klazz=c.loadClass(choice.substring(0,choice.indexOf("String_Node_Str")));
            Constructor<?> construct=klazz.getConstructor();
            plugin=(AIPlugin)construct.newInstance();
            Thread aiThread;
            aiThread=new Thread(new Runnable(){
              @Override public void run(){
                try {
                  ai.runGame(plugin);
                }
 catch (                Exception e) {
                  e.printStackTrace();
                }
              }
            }
);
            aiThread.start();
          }
 catch (          Exception e1) {
            e1.printStackTrace();
          }
          try {
            PlayNetGame png=new PlayNetGame(toPlay,false,false);
            png.setAIGame(true);
            Driver.getInstance().setPanel(png);
          }
 catch (          Exception e) {
            return;
          }
          popped.dispose();
        }
      }
);
      JButton back=new JButton("String_Node_Str");
      back.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          popped.dispose();
        }
      }
);
      JPanel buttons=new JPanel();
      buttons.setLayout(new FlowLayout());
      buttons.add(back);
      buttons.add(next);
      c.gridx=0;
      c.gridy=2;
      c.gridwidth=2;
      popped.add(buttons,c);
      popped.setVisible(true);
    }
  }
);
  backButton=new JButton("String_Node_Str");
  backButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      Driver.getInstance().helpMenu.setText("String_Node_Str");
      Driver.getInstance().gamePlayHelp.setVisible(false);
      Driver.getInstance().revertPanel();
    }
  }
);
  try {
    if (InetAddress.getLocalHost().getHostName().contains("String_Node_Str")) {
      c.gridx=0;
      c.gridy=0;
      c.fill=GridBagConstraints.HORIZONTAL;
      c.insets=new Insets(5,5,0,0);
      add(humanPlay,c);
      c.gridx=1;
      c.gridy=0;
      c.fill=GridBagConstraints.HORIZONTAL;
      c.insets=new Insets(5,5,0,5);
      add(networkPlay,c);
      c.gridx=0;
      c.gridy=1;
      c.gridwidth=2;
      c.insets=new Insets(0,5,20,5);
      c.fill=GridBagConstraints.HORIZONTAL;
      add(AIPlay,c);
      c.gridx=0;
      c.gridy=2;
      add(backButton,c);
    }
 else {
      c.gridx=0;
      c.gridy=0;
      c.fill=GridBagConstraints.HORIZONTAL;
      c.insets=new Insets(5,5,0,5);
      add(humanPlay,c);
      c.gridx=0;
      c.gridy=1;
      c.insets=new Insets(0,5,20,5);
      c.fill=GridBagConstraints.HORIZONTAL;
      add(AIPlay,c);
      c.gridx=0;
      c.gridy=2;
      add(backButton,c);
    }
  }
 catch (  Exception e) {
  }
}