Program: 94593
Project: 94593
Buggy source:
@Override public void show(){
  Configuration config=parent.getConfiguration();
  new SettingsLoader().merge(config);
  List<GPUDevice> gpus=GPU.listDevices();
  GridBagConstraints constraints=new GridBagConstraints();
  int columns=Math.max(5,4 + (gpus != null ? gpus.size() : 0));
  int currentRow=0;
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  ImageIcon image=new ImageIcon(getClass().getResource("String_Node_Str"));
  JLabel labelImage=new JLabel(image);
  labelImage.setBorder(BorderFactory.createMatteBorder(0,0,2,0,Color.DARK_GRAY));
  constraints.fill=GridBagConstraints.BOTH;
  constraints.weightx=1.0;
  constraints.weighty=3.0;
  constraints.gridwidth=columns - 2;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(labelImage,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel loginLabel=new JLabel("String_Node_Str");
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.weighty=0.0;
  constraints.gridwidth=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(loginLabel,constraints);
  login=new JTextField();
  login.setText(parent.getConfiguration().login());
  login.setColumns(20);
  login.addKeyListener(new CheckCanStart());
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(login,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel passwordLabel=new JLabel("String_Node_Str");
  constraints.weighty=0.0;
  constraints.gridwidth=1;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(passwordLabel,constraints);
  password=new JPasswordField();
  password.setText(parent.getConfiguration().password());
  password.setColumns(10);
  password.addKeyListener(new CheckCanStart());
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(password,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel proxyLabel=new JLabel("String_Node_Str");
  proxyLabel.setToolTipText("String_Node_Str");
  constraints.gridwidth=1;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(proxyLabel,constraints);
  proxy=new JTextField();
  proxy.setToolTipText("String_Node_Str");
  proxy.setText(parent.getConfiguration().getProxy());
  proxy.addKeyListener(new CheckCanStart());
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(proxy,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel cacheLabel=new JLabel("String_Node_Str");
  constraints.gridwidth=1;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(cacheLabel,constraints);
  String destination=DUMMY_CACHE_DIR;
  if (config.getUserSpecifiedACacheDir()) {
    destination=config.getStorageDir().getName();
  }
  cacheDirText=new JLabel(destination);
  constraints.weightx=1.0;
  constraints.gridwidth=columns - 4;
  constraints.gridx=2;
  parent.getContentPane().add(cacheDirText,constraints);
  cacheDirChooser=new JFileChooser();
  cacheDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  JButton openButton=new JButton("String_Node_Str");
  openButton.addActionListener(new ChooseFileAction());
  constraints.weightx=0.0;
  constraints.gridwidth=1;
  constraints.gridx=columns - 2;
  parent.getContentPane().add(openButton,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel computeMethodLabel=new JLabel("String_Node_Str");
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(computeMethodLabel,constraints);
  ComputeType method=config.getComputeMethod();
  useCPU=new JCheckBox("String_Node_Str");
  boolean gpuChecked=false;
  if (method == ComputeType.CPU_GPU) {
    useCPU.setSelected(true);
    gpuChecked=true;
  }
 else   if (method == ComputeType.CPU) {
    useCPU.setSelected(true);
    gpuChecked=false;
  }
 else   if (method == ComputeType.GPU) {
    useCPU.setSelected(false);
    gpuChecked=true;
  }
  useCPU.addActionListener(new CpuChangeAction());
  constraints.gridwidth=Math.max(1,columns - (gpus != null ? gpus.size() : 0) - 3);
  constraints.gridx=2;
  parent.getContentPane().add(useCPU,constraints);
  constraints.gridwidth=1;
  if (gpus != null) {
    for (int i=0; i < gpus.size(); i++) {
      GPUDevice gpu=gpus.get(i);
      JCheckBoxGPU gpuCheckBox=new JCheckBoxGPU(gpu);
      gpuCheckBox.setToolTipText(gpu.getCudaName());
      if (gpuChecked) {
        GPUDevice config_gpu=config.getGPUDevice();
        if (config_gpu != null && config_gpu.getCudaName().equals(gpu.getCudaName())) {
          gpuCheckBox.setSelected(gpuChecked);
        }
      }
      gpuCheckBox.addActionListener(new GpuChangeAction());
      constraints.gridx=i + 3;
      parent.getContentPane().add(gpuCheckBox,constraints);
      useGPUs.add(gpuCheckBox);
    }
  }
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  CPU cpu=new CPU();
  if (cpu.cores() > 1) {
    cpuCores=new JSlider(1,cpu.cores());
    cpuCores.setMajorTickSpacing(1);
    cpuCores.setMinorTickSpacing(1);
    cpuCores.setPaintTicks(true);
    cpuCores.setPaintLabels(true);
    cpuCores.setValue(config.getNbCores() != -1 ? config.getNbCores() : cpuCores.getMaximum());
    JLabel coreLabel=new JLabel("String_Node_Str");
    constraints.gridx=1;
    constraints.gridy=currentRow;
    parent.getContentPane().add(coreLabel,constraints);
    constraints.gridwidth=columns - 3;
    constraints.gridx=2;
    parent.getContentPane().add(cpuCores,constraints);
    parent.addPadding(1,++currentRow,columns - 2,1);
    ++currentRow;
  }
  saveFile=new JCheckBox("String_Node_Str",true);
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  constraints.gridy=currentRow;
  parent.getContentPane().add(saveFile,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  autoSignIn=new JCheckBox("String_Node_Str",config.getAutoSignIn());
  autoSignIn.addActionListener(new AutoSignInChangeAction());
  constraints.gridy=currentRow;
  parent.getContentPane().add(autoSignIn,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  saveButton=new JButton("String_Node_Str");
  checkDisplaySaveButton();
  saveButton.addActionListener(new SaveAction());
  constraints.gridwidth=columns - 2;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(saveButton,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  parent.addPadding(0,0,1,currentRow + 1);
  parent.addPadding(columns - 1,0,1,currentRow + 1);
  if (haveAutoStarted == false && config.getAutoSignIn() && checkDisplaySaveButton()) {
    haveAutoStarted=true;
    new SaveAction().actionPerformed(null);
  }
}

Fixed version (ground truth):
@Override public void show(){
  Configuration config=parent.getConfiguration();
  new SettingsLoader().merge(config);
  List<GPUDevice> gpus=GPU.listDevices();
  GridBagConstraints constraints=new GridBagConstraints();
  int columns=4 + (gpus != null ? gpus.size() : 0);
  int currentRow=0;
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  ImageIcon image=new ImageIcon(getClass().getResource("String_Node_Str"));
  JLabel labelImage=new JLabel(image);
  constraints.fill=GridBagConstraints.BOTH;
  constraints.weightx=1.0;
  constraints.weighty=3.0;
  constraints.gridwidth=columns - 2;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(labelImage,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel loginLabel=new JLabel("String_Node_Str");
  constraints.fill=GridBagConstraints.HORIZONTAL;
  constraints.weighty=0.0;
  constraints.gridwidth=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(loginLabel,constraints);
  login=new JTextField();
  login.setText(parent.getConfiguration().login());
  login.setColumns(20);
  login.addKeyListener(new CheckCanStart());
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(login,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel passwordLabel=new JLabel("String_Node_Str");
  constraints.weighty=0.0;
  constraints.gridwidth=1;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(passwordLabel,constraints);
  password=new JPasswordField();
  password.setText(parent.getConfiguration().password());
  password.setColumns(10);
  password.addKeyListener(new CheckCanStart());
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(password,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel proxyLabel=new JLabel("String_Node_Str");
  proxyLabel.setToolTipText("String_Node_Str");
  constraints.gridwidth=1;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(proxyLabel,constraints);
  proxy=new JTextField();
  proxy.setToolTipText("String_Node_Str");
  proxy.setText(parent.getConfiguration().getProxy());
  proxy.addKeyListener(new CheckCanStart());
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(proxy,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel cacheLabel=new JLabel("String_Node_Str");
  constraints.gridwidth=1;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(cacheLabel,constraints);
  String destination=DUMMY_CACHE_DIR;
  if (config.getUserSpecifiedACacheDir()) {
    destination=config.getStorageDir().getName();
  }
  JPanel cacheDirWrapper=new JPanel();
  cacheDirWrapper.setLayout(new BoxLayout(cacheDirWrapper,BoxLayout.LINE_AXIS));
  cacheDirText=new JLabel(destination);
  cacheDirWrapper.add(cacheDirText);
  cacheDirWrapper.add(Box.createHorizontalGlue());
  cacheDirChooser=new JFileChooser();
  cacheDirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  JButton openButton=new JButton("String_Node_Str");
  openButton.addActionListener(new ChooseFileAction());
  cacheDirWrapper.add(openButton);
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  parent.getContentPane().add(cacheDirWrapper,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  JLabel computeMethodLabel=new JLabel("String_Node_Str");
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(computeMethodLabel,constraints);
  ComputeType method=config.getComputeMethod();
  useCPU=new JCheckBox("String_Node_Str");
  boolean gpuChecked=false;
  if (method == ComputeType.CPU_GPU) {
    useCPU.setSelected(true);
    gpuChecked=true;
  }
 else   if (method == ComputeType.CPU) {
    useCPU.setSelected(true);
    gpuChecked=false;
  }
 else   if (method == ComputeType.GPU) {
    useCPU.setSelected(false);
    gpuChecked=true;
  }
  useCPU.addActionListener(new CpuChangeAction());
  constraints.gridwidth=Math.max(1,columns - (gpus != null ? gpus.size() : 0) - 3);
  constraints.gridx=2;
  parent.getContentPane().add(useCPU,constraints);
  constraints.gridwidth=1;
  if (gpus != null) {
    for (int i=0; i < gpus.size(); i++) {
      GPUDevice gpu=gpus.get(i);
      JCheckBoxGPU gpuCheckBox=new JCheckBoxGPU(gpu);
      gpuCheckBox.setToolTipText(gpu.getCudaName());
      if (gpuChecked) {
        GPUDevice config_gpu=config.getGPUDevice();
        if (config_gpu != null && config_gpu.getCudaName().equals(gpu.getCudaName())) {
          gpuCheckBox.setSelected(gpuChecked);
        }
      }
      gpuCheckBox.addActionListener(new GpuChangeAction());
      constraints.gridx=i + 3;
      parent.getContentPane().add(gpuCheckBox,constraints);
      useGPUs.add(gpuCheckBox);
    }
  }
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  CPU cpu=new CPU();
  if (cpu.cores() > 1) {
    cpuCores=new JSlider(1,cpu.cores());
    cpuCores.setMajorTickSpacing(1);
    cpuCores.setMinorTickSpacing(1);
    cpuCores.setPaintTicks(true);
    cpuCores.setPaintLabels(true);
    cpuCores.setValue(config.getNbCores() != -1 ? config.getNbCores() : cpuCores.getMaximum());
    JLabel coreLabel=new JLabel("String_Node_Str");
    constraints.gridx=1;
    constraints.gridy=currentRow;
    parent.getContentPane().add(coreLabel,constraints);
    constraints.gridwidth=columns - 3;
    constraints.gridx=2;
    parent.getContentPane().add(cpuCores,constraints);
    parent.addPadding(1,++currentRow,columns - 2,1);
    ++currentRow;
  }
  saveFile=new JCheckBox("String_Node_Str",true);
  constraints.gridwidth=columns - 3;
  constraints.gridx=2;
  constraints.gridy=currentRow;
  parent.getContentPane().add(saveFile,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  autoSignIn=new JCheckBox("String_Node_Str",config.getAutoSignIn());
  autoSignIn.addActionListener(new AutoSignInChangeAction());
  constraints.gridy=currentRow;
  parent.getContentPane().add(autoSignIn,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  ++currentRow;
  saveButton=new JButton("String_Node_Str");
  checkDisplaySaveButton();
  saveButton.addActionListener(new SaveAction());
  constraints.gridwidth=columns - 2;
  constraints.gridx=1;
  constraints.gridy=currentRow;
  parent.getContentPane().add(saveButton,constraints);
  parent.addPadding(1,++currentRow,columns - 2,1);
  parent.addPadding(0,0,1,currentRow + 1);
  parent.addPadding(columns - 1,0,1,currentRow + 1);
  if (haveAutoStarted == false && config.getAutoSignIn() && checkDisplaySaveButton()) {
    haveAutoStarted=true;
    new SaveAction().actionPerformed(null);
  }
}