nus-yam/ex-repair huggingface dataset:
Program: 17722
Project: 17722
Buggy source:
@Override public void setFields(){
switch (type) {
case TextFile:
    this.list.setSelectedIndex(0);
  break;
case MachineLearningMethod:
this.list.setSelectedIndex(1);
break;
case CSVFile:
this.list.setSelectedIndex(2);
break;
case TrainingFile:
this.list.setSelectedIndex(3);
break;
}
}

Fixed version (ground truth):
@Override public void setFields(){
switch (type) {
case TextFile:
    this.list.setSelectedIndex(0);
  break;
case MachineLearningMethod:
this.list.setSelectedIndex(1);
break;
case CSVFile:
this.list.setSelectedIndex(2);
break;
case TrainingFile:
this.list.setSelectedIndex(3);
break;
case NEAT:
this.list.setSelectedIndex(4);
break;
}
}
Program: 17723
Project: 17723
Buggy source:
public CreateFileDialog(Frame owner){
  super(owner);
  setTitle("String_Node_Str");
  JPanel top=new JPanel();
  JPanel bottom=new JPanel();
  this.setSize(500,250);
  this.setLocation(50,100);
  final Container content=getBodyPanel();
  content.setLayout(new BorderLayout());
  top.setLayout(new GridLayout(1,2));
  top.add(this.scroll1);
  top.add(this.scroll2);
  GridBagLayout gridBag=new GridBagLayout();
  GridBagConstraints c=new GridBagConstraints();
  c.fill=GridBagConstraints.BOTH;
  c.weightx=0.0;
  content.add(top,BorderLayout.CENTER);
  bottom.setLayout(gridBag);
  Component comp1=new JLabel("String_Node_Str");
  this.objectNameField=new JTextField(20);
  gridBag.setConstraints(comp1,c);
  c.weightx=1.0;
  gridBag.setConstraints(this.objectNameField,c);
  bottom.add(comp1);
  bottom.add(this.objectNameField);
  content.add(bottom,BorderLayout.SOUTH);
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.list.addListSelectionListener(this);
  this.text.setLineWrap(true);
  this.text.setWrapStyleWord(true);
  this.text.setEditable(false);
  scroll2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
}

Fixed version (ground truth):
public CreateFileDialog(Frame owner){
  super(owner);
  setTitle("String_Node_Str");
  JPanel top=new JPanel();
  JPanel bottom=new JPanel();
  this.setSize(500,250);
  this.setLocation(50,100);
  final Container content=getBodyPanel();
  content.setLayout(new BorderLayout());
  top.setLayout(new GridLayout(1,2));
  top.add(this.scroll1);
  top.add(this.scroll2);
  GridBagLayout gridBag=new GridBagLayout();
  GridBagConstraints c=new GridBagConstraints();
  c.fill=GridBagConstraints.BOTH;
  c.weightx=0.0;
  content.add(top,BorderLayout.CENTER);
  bottom.setLayout(gridBag);
  Component comp1=new JLabel("String_Node_Str");
  this.objectNameField=new JTextField(20);
  gridBag.setConstraints(comp1,c);
  c.weightx=1.0;
  gridBag.setConstraints(this.objectNameField,c);
  bottom.add(comp1);
  bottom.add(this.objectNameField);
  content.add(bottom,BorderLayout.SOUTH);
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.model.addElement("String_Node_Str");
  this.list.addListSelectionListener(this);
  this.text.setLineWrap(true);
  this.text.setWrapStyleWord(true);
  this.text.setEditable(false);
  scroll2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
}
Program: 17724
Project: 17724
Buggy source:
@Override public void setFields(){
switch (type) {
case Automatic:
    this.list.setSelectedIndex(1);
  break;
case ADALINE:
this.list.setSelectedIndex(2);
break;
case ART1:
this.list.setSelectedIndex(3);
break;
case BAM:
this.list.setSelectedIndex(4);
break;
case Boltzmann:
this.list.setSelectedIndex(5);
break;
case CPN:
this.list.setSelectedIndex(6);
break;
case Feedforward:
this.list.setSelectedIndex(7);
break;
case RBF:
this.list.setSelectedIndex(8);
break;
case SOM:
this.list.setSelectedIndex(9);
break;
case Hopfield:
this.list.setSelectedIndex(10);
break;
case Elman:
this.list.setSelectedIndex(11);
break;
case Jordan:
this.list.setSelectedIndex(12);
break;
case SVM:
this.list.setSelectedIndex(13);
break;
}
}

Fixed version (ground truth):
@Override public void setFields(){
switch (type) {
case Automatic:
    this.list.setSelectedIndex(0);
  break;
case ADALINE:
this.list.setSelectedIndex(1);
break;
case ART1:
this.list.setSelectedIndex(2);
break;
case BAM:
this.list.setSelectedIndex(3);
break;
case Boltzmann:
this.list.setSelectedIndex(4);
break;
case CPN:
this.list.setSelectedIndex(5);
break;
case Feedforward:
this.list.setSelectedIndex(6);
break;
case RBF:
this.list.setSelectedIndex(7);
break;
case SOM:
this.list.setSelectedIndex(8);
break;
case Hopfield:
this.list.setSelectedIndex(9);
break;
case Elman:
this.list.setSelectedIndex(10);
break;
case Jordan:
this.list.setSelectedIndex(11);
break;
case SVM:
this.list.setSelectedIndex(12);
break;
}
}
Program: 17725
Project: 17725
Buggy source:
public void save(String name,Object network){
  File file=new File(getProjectDirectory(),name);
  EncogDirectoryPersistence.saveObject(file,network);
  refresh();
}

Fixed version (ground truth):
public void save(File path,Object network){
  EncogDirectoryPersistence.saveObject(path,network);
  refresh();
}
Program: 17726
Project: 17726
Buggy source:
/** 
 * @return The network that the user chose.
 */
public NEATPopulation getPopulation(){
  if (this.comboPopulation.getSelectedValue() == null)   return null;
  return null;
}

Fixed version (ground truth):
/** 
 * @return The network that the user chose.
 */
public ProjectEGFile getPopulation(){
  if (this.comboPopulation.getSelectedValue() == null)   return null;
  return ((ProjectEGFile)this.comboPopulation.getSelectedValue());
}
Program: 17727
Project: 17727
Buggy source:
/** 
 * Obtain the data needed to fill in the network and training set combo boxes.
 */
private void findData(){
  this.trainingSets=EncogWorkBench.getInstance().getTrainingData();
}

Fixed version (ground truth):
/** 
 * Obtain the data needed to fill in the network and training set combo boxes.
 */
private void findData(){
  this.trainingSets=EncogWorkBench.getInstance().getTrainingData();
  this.populations=EncogWorkBench.getInstance().getNEATPopulations();
}
Program: 17728
Project: 17728
Buggy source:
public void openFile(ProjectFile file){
  try {
    EncogWorkBench.getInstance().getMainWindow().beginWait();
    EncogCommonTab tab=this.tabManager.find(file);
    if (file instanceof ProjectEGFile) {
      openEGFile((ProjectEGFile)file);
      return;
    }
    if (tab == null) {
      String extension=FileUtil.getFileExt(file.getFile());
      if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new TextFileTab(file);
        this.openTab(tab);
      }
 else       if (extension.equals("String_Node_Str")) {
        tab=new EncogAnalystTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new BinaryDataTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")|| extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new ImageFileTab(file);
        this.openTab(tab);
      }
 else {
        tab=new GenericFileTab(file);
        this.openTab(tab);
      }
    }
 else {
      this.documentTabs.setSelectedComponent(tab);
      this.menus.updateMenus();
    }
  }
  finally {
    EncogWorkBench.getInstance().getMainWindow().endWait();
  }
}

Fixed version (ground truth):
public void openFile(ProjectFile file){
  try {
    EncogWorkBench.getInstance().getMainWindow().beginWait();
    EncogCommonTab tab=this.tabManager.find(file);
    if (file instanceof ProjectEGFile) {
      openEGFile((ProjectEGFile)file);
      return;
    }
    if (tab == null) {
      String extension=FileUtil.getFileExt(file.getFile());
      if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new TextFileTab(file);
        this.openTab(tab);
      }
 else       if (extension.equals("String_Node_Str")) {
        tab=new EncogAnalystTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new BinaryDataTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")|| extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new ImageFileTab(file);
        this.openTab(tab);
      }
 else {
        tab=new GenericFileTab(file);
        this.openTab(tab);
      }
    }
 else {
      this.documentTabs.setSelectedComponent(tab);
      this.menus.updateMenus();
    }
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t);
  }
 finally {
    EncogWorkBench.getInstance().getMainWindow().endWait();
  }
}
Program: 17729
Project: 17729
Buggy source:
public void openEGFile(ProjectEGFile file){
  Object obj=file.getObject();
  EncogCommonTab tab=null;
  if (obj instanceof MLMethod) {
    tab=new MLMethodTab(file);
  }
 else {
    tab=new GenericFileTab(file);
    this.openTab(tab);
  }
  if (tab != null)   openTab(tab);
}

Fixed version (ground truth):
public void openEGFile(ProjectEGFile file){
  Object obj=file.getObject();
  EncogCommonTab tab=null;
  if (obj instanceof MLMethod) {
    tab=new MLMethodTab(file);
  }
 else   if (obj instanceof NEATPopulation) {
    tab=new NEATPopulationTab(file);
  }
 else {
    tab=new GenericFileTab(file);
    this.openTab(tab);
  }
  if (tab != null)   openTab(tab);
}
Program: 17730
Project: 17730
Buggy source:
private static BasicNetwork createAutomatic(String name){
  CreateAutomatic dialog=new CreateAutomatic(EncogWorkBench.getInstance().getMainWindow());
  dialog.setActivationFunction(new ActivationTANH());
  dialog.getWeightTries().setValue(5);
  dialog.getIterations().setValue(25);
  dialog.getWindowSize().setValue(10);
  if (dialog.process()) {
    NeuralDataSet training=dialog.getTraining();
    if (training == null) {
      return null;
    }
    FeedForwardPattern pattern=new FeedForwardPattern();
    pattern.setInputNeurons(training.getInputSize());
    pattern.setOutputNeurons(training.getIdealSize());
    pattern.setActivationFunction(dialog.getActivationFunction());
    IncrementalPruneTab tab=new IncrementalPruneTab(dialog.getIterations().getValue(),dialog.getWeightTries().getValue(),dialog.getWindowSize().getValue(),training,pattern,name);
    for (int i=0; i < dialog.getHidden().getModel().size(); i++) {
      String str=(String)dialog.getHidden().getModel().getElementAt(i);
      String lowStr=BotUtil.extract(str,"String_Node_Str","String_Node_Str",0);
      String highStr=BotUtil.extract(str,"String_Node_Str","String_Node_Str",0);
      int low=Integer.parseInt(lowStr);
      int high=Integer.parseInt(highStr);
      tab.addHiddenRange(low,high);
    }
    EncogWorkBench.getInstance().getMainWindow().openModalTab(tab,"String_Node_Str");
    return null;
  }
  return null;
}

Fixed version (ground truth):
private static BasicNetwork createAutomatic(){
  CreateAutomatic dialog=new CreateAutomatic(EncogWorkBench.getInstance().getMainWindow());
  dialog.setActivationFunction(new ActivationTANH());
  dialog.getWeightTries().setValue(5);
  dialog.getIterations().setValue(25);
  dialog.getWindowSize().setValue(10);
  if (dialog.process()) {
    NeuralDataSet training=dialog.getTraining();
    if (training == null) {
      return null;
    }
    FeedForwardPattern pattern=new FeedForwardPattern();
    pattern.setInputNeurons(training.getInputSize());
    pattern.setOutputNeurons(training.getIdealSize());
    pattern.setActivationFunction(dialog.getActivationFunction());
    IncrementalPruneTab tab=new IncrementalPruneTab(dialog.getIterations().getValue(),dialog.getWeightTries().getValue(),dialog.getWindowSize().getValue(),training,pattern);
    for (int i=0; i < dialog.getHidden().getModel().size(); i++) {
      String str=(String)dialog.getHidden().getModel().getElementAt(i);
      String lowStr=BotUtil.extract(str,"String_Node_Str","String_Node_Str",0);
      String highStr=BotUtil.extract(str,"String_Node_Str","String_Node_Str",0);
      int low=Integer.parseInt(lowStr);
      int high=Integer.parseInt(highStr);
      tab.addHiddenRange(low,high);
    }
    EncogWorkBench.getInstance().getMainWindow().openModalTab(tab,"String_Node_Str");
    return null;
  }
  return null;
}
Program: 17731
Project: 17731
Buggy source:
public static void process(String name){
  MLMethod network=null;
  CreateNeuralNetworkDialog dialog=new CreateNeuralNetworkDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setType(NeuralNetworkType.Feedforward);
  if (dialog.process()) {
switch (dialog.getType()) {
case Automatic:
      createAutomatic(name);
    network=null;
  break;
case Feedforward:
network=createFeedForward(name);
break;
case SOM:
network=createSOM(name);
break;
case Hopfield:
network=createHopfield(name);
break;
case Elman:
network=createElman(name);
break;
case Jordan:
network=createJordan(name);
break;
case RBF:
network=createRBF(name);
break;
case BAM:
network=createBAM(name);
break;
case CPN:
network=createCPN(name);
break;
case Boltzmann:
network=createBoltzmann(name);
break;
case ADALINE:
network=createADALINE(name);
break;
case ART1:
network=createART1(name);
break;
case SVM:
network=createSVM(name);
break;
}
if (network != null) {
EncogWorkBench.getInstance().save(name,network);
}
}
}

Fixed version (ground truth):
public static void process(File path){
  MLMethod network=null;
  CreateNeuralNetworkDialog dialog=new CreateNeuralNetworkDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setType(NeuralNetworkType.Feedforward);
  if (dialog.process()) {
switch (dialog.getType()) {
case Automatic:
      createAutomatic();
    network=null;
  break;
case Feedforward:
network=createFeedForward();
break;
case SOM:
network=createSOM();
break;
case Hopfield:
network=createHopfield();
break;
case Elman:
network=createElman();
break;
case Jordan:
network=createJordan();
break;
case RBF:
network=createRBF();
break;
case BAM:
network=createBAM();
break;
case CPN:
network=createCPN();
break;
case Boltzmann:
network=createBoltzmann();
break;
case ADALINE:
network=createADALINE();
break;
case ART1:
network=createART1();
break;
case SVM:
network=createSVM();
break;
}
if (network != null) {
EncogWorkBench.getInstance().save(path,network);
}
}
}
Program: 17732
Project: 17732
Buggy source:
private static MLMethod createFeedForward(String name){
  CreateFeedforward dialog=new CreateFeedforward(EncogWorkBench.getInstance().getMainWindow());
  dialog.setActivationFunctionHidden(new ActivationTANH());
  dialog.setActivationFunctionOutput(new ActivationTANH());
  if (dialog.process()) {
    FeedForwardPattern feedforward=new FeedForwardPattern();
    feedforward.setActivationFunction(dialog.getActivationFunctionHidden());
    feedforward.setActivationOutput(dialog.getActivationFunctionOutput());
    feedforward.setInputNeurons(dialog.getInputCount().getValue());
    for (int i=0; i < dialog.getHidden().getModel().size(); i++) {
      String str=(String)dialog.getHidden().getModel().getElementAt(i);
      int i1=str.indexOf(':');
      int i2=str.indexOf("String_Node_Str");
      if (i1 != -1 && i2 != -1) {
        str=str.substring(i1 + 1,i2).trim();
        int neuronCount=Integer.parseInt(str);
        feedforward.addHiddenLayer(neuronCount);
      }
    }
    feedforward.setInputNeurons(dialog.getInputCount().getValue());
    feedforward.setOutputNeurons(dialog.getOutputCount().getValue());
    return feedforward.generate();
  }
  return null;
}

Fixed version (ground truth):
private static MLMethod createFeedForward(){
  CreateFeedforward dialog=new CreateFeedforward(EncogWorkBench.getInstance().getMainWindow());
  dialog.setActivationFunctionHidden(new ActivationTANH());
  dialog.setActivationFunctionOutput(new ActivationTANH());
  if (dialog.process()) {
    FeedForwardPattern feedforward=new FeedForwardPattern();
    feedforward.setActivationFunction(dialog.getActivationFunctionHidden());
    feedforward.setActivationOutput(dialog.getActivationFunctionOutput());
    feedforward.setInputNeurons(dialog.getInputCount().getValue());
    for (int i=0; i < dialog.getHidden().getModel().size(); i++) {
      String str=(String)dialog.getHidden().getModel().getElementAt(i);
      int i1=str.indexOf(':');
      int i2=str.indexOf("String_Node_Str");
      if (i1 != -1 && i2 != -1) {
        str=str.substring(i1 + 1,i2).trim();
        int neuronCount=Integer.parseInt(str);
        feedforward.addHiddenLayer(neuronCount);
      }
    }
    feedforward.setInputNeurons(dialog.getInputCount().getValue());
    feedforward.setOutputNeurons(dialog.getOutputCount().getValue());
    return feedforward.generate();
  }
  return null;
}
Program: 17733
Project: 17733
Buggy source:
private static MLMethod createBoltzmann(String name){
  CreateBlotzmannDialog dialog=new CreateBlotzmannDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    BoltzmannPattern boltz=new BoltzmannPattern();
    boltz.setInputNeurons(dialog.getNeuronCount().getValue());
    return boltz.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createBoltzmann(){
  CreateBlotzmannDialog dialog=new CreateBlotzmannDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    BoltzmannPattern boltz=new BoltzmannPattern();
    boltz.setInputNeurons(dialog.getNeuronCount().getValue());
    return boltz.generate();
  }
 else   return null;
}
Program: 17734
Project: 17734
Buggy source:
private static MLMethod createSVM(String name){
  CreateSVMDialog dialog=new CreateSVMDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setSVMType(SVMType.EpsilonSupportVectorRegression);
  dialog.setKernelType(KernelType.RadialBasisFunction);
  if (dialog.process()) {
    SVMPattern svm=new SVMPattern();
    svm.setInputNeurons(dialog.getInputCount().getValue());
    svm.setOutputNeurons(dialog.getOutputCount().getValue());
    svm.setKernelType(dialog.getKernelType());
    svm.setSVMType(dialog.getSVMType());
    return svm.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createSVM(){
  CreateSVMDialog dialog=new CreateSVMDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setSVMType(SVMType.EpsilonSupportVectorRegression);
  dialog.setKernelType(KernelType.RadialBasisFunction);
  if (dialog.process()) {
    SVMPattern svm=new SVMPattern();
    svm.setInputNeurons(dialog.getInputCount().getValue());
    svm.setOutputNeurons(dialog.getOutputCount().getValue());
    svm.setKernelType(dialog.getKernelType());
    svm.setSVMType(dialog.getSVMType());
    return svm.generate();
  }
 else   return null;
}
Program: 17735
Project: 17735
Buggy source:
private static MLMethod createJordan(String name){
  CreateJordanDialog dialog=new CreateJordanDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    JordanPattern jordan=new JordanPattern();
    jordan.setInputNeurons(dialog.getInputCount().getValue());
    jordan.addHiddenLayer(dialog.getHiddenCount().getValue());
    jordan.setOutputNeurons(dialog.getOutputCount().getValue());
    jordan.setActivationFunction(new ActivationTANH());
    return jordan.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createJordan(){
  CreateJordanDialog dialog=new CreateJordanDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    JordanPattern jordan=new JordanPattern();
    jordan.setInputNeurons(dialog.getInputCount().getValue());
    jordan.addHiddenLayer(dialog.getHiddenCount().getValue());
    jordan.setOutputNeurons(dialog.getOutputCount().getValue());
    jordan.setActivationFunction(new ActivationTANH());
    return jordan.generate();
  }
 else   return null;
}
Program: 17736
Project: 17736
Buggy source:
private static MLMethod createCPN(String name){
  CreateCPNDialog dialog=new CreateCPNDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    CPNPattern cpn=new CPNPattern();
    cpn.setInputNeurons(dialog.getInputCount().getValue());
    cpn.setInstarCount(dialog.getInstarCount().getValue());
    cpn.setOutstarCount(dialog.getOutstarCount().getValue());
    return cpn.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createCPN(){
  CreateCPNDialog dialog=new CreateCPNDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    CPNPattern cpn=new CPNPattern();
    cpn.setInputNeurons(dialog.getInputCount().getValue());
    cpn.setInstarCount(dialog.getInstarCount().getValue());
    cpn.setOutstarCount(dialog.getOutstarCount().getValue());
    return cpn.generate();
  }
 else   return null;
}
Program: 17737
Project: 17737
Buggy source:
private static MLMethod createRBF(String name){
  CreateRBFDialog dialog=new CreateRBFDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    RadialBasisPattern rbf=new RadialBasisPattern();
    rbf.setInputNeurons(dialog.getInputCount().getValue());
    rbf.addHiddenLayer(dialog.getHiddenCount().getValue());
    rbf.setOutputNeurons(dialog.getOutputCount().getValue());
    return rbf.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createRBF(){
  CreateRBFDialog dialog=new CreateRBFDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    RadialBasisPattern rbf=new RadialBasisPattern();
    rbf.setInputNeurons(dialog.getInputCount().getValue());
    rbf.addHiddenLayer(dialog.getHiddenCount().getValue());
    rbf.setOutputNeurons(dialog.getOutputCount().getValue());
    return rbf.generate();
  }
 else   return null;
}
Program: 17738
Project: 17738
Buggy source:
private static MLMethod createADALINE(String name){
  CreateADALINEDialog dialog=new CreateADALINEDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    ADALINEPattern adaline=new ADALINEPattern();
    adaline.setInputNeurons(dialog.getNeuronCount().getValue());
    adaline.setOutputNeurons(dialog.getElementCount().getValue());
    return adaline.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createADALINE(){
  CreateADALINEDialog dialog=new CreateADALINEDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    ADALINEPattern adaline=new ADALINEPattern();
    adaline.setInputNeurons(dialog.getNeuronCount().getValue());
    adaline.setOutputNeurons(dialog.getElementCount().getValue());
    return adaline.generate();
  }
 else   return null;
}
Program: 17739
Project: 17739
Buggy source:
private static MLMethod createElman(String name){
  CreateElmanDialog dialog=new CreateElmanDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    ElmanPattern elman=new ElmanPattern();
    elman.setInputNeurons(dialog.getInputCount().getValue());
    elman.addHiddenLayer(dialog.getHiddenCount().getValue());
    elman.setOutputNeurons(dialog.getOutputCount().getValue());
    elman.setActivationFunction(new ActivationTANH());
    return elman.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createElman(){
  CreateElmanDialog dialog=new CreateElmanDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    ElmanPattern elman=new ElmanPattern();
    elman.setInputNeurons(dialog.getInputCount().getValue());
    elman.addHiddenLayer(dialog.getHiddenCount().getValue());
    elman.setOutputNeurons(dialog.getOutputCount().getValue());
    elman.setActivationFunction(new ActivationTANH());
    return elman.generate();
  }
 else   return null;
}
Program: 17740
Project: 17740
Buggy source:
private static MLMethod createHopfield(String name){
  CreateHopfieldDialog dialog=new CreateHopfieldDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    HopfieldPattern hopfield=new HopfieldPattern();
    hopfield.setInputNeurons(dialog.getNeuronCount().getValue());
    return hopfield.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createHopfield(){
  CreateHopfieldDialog dialog=new CreateHopfieldDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    HopfieldPattern hopfield=new HopfieldPattern();
    hopfield.setInputNeurons(dialog.getNeuronCount().getValue());
    return hopfield.generate();
  }
 else   return null;
}
Program: 17741
Project: 17741
Buggy source:
private static MLMethod createART1(String name){
  CreateART1 dialog=new CreateART1(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    ART1Pattern art1=new ART1Pattern();
    art1.setInputNeurons(dialog.getF1().getValue());
    art1.setOutputNeurons(dialog.getF2().getValue());
    return art1.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createART1(){
  CreateART1 dialog=new CreateART1(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    ART1Pattern art1=new ART1Pattern();
    art1.setInputNeurons(dialog.getF1().getValue());
    art1.setOutputNeurons(dialog.getF2().getValue());
    return art1.generate();
  }
 else   return null;
}
Program: 17742
Project: 17742
Buggy source:
private static MLMethod createBAM(String name){
  CreateBAMDialog dialog=new CreateBAMDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    BAMPattern bam=new BAMPattern();
    bam.setF1Neurons(dialog.getLayerACount().getValue());
    bam.setF2Neurons(dialog.getLayerBCount().getValue());
    return bam.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createBAM(){
  CreateBAMDialog dialog=new CreateBAMDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    BAMPattern bam=new BAMPattern();
    bam.setF1Neurons(dialog.getLayerACount().getValue());
    bam.setF2Neurons(dialog.getLayerBCount().getValue());
    return bam.generate();
  }
 else   return null;
}
Program: 17743
Project: 17743
Buggy source:
private static MLMethod createSOM(String name){
  CreateSOMDialog dialog=new CreateSOMDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    SOMPattern som=new SOMPattern();
    som.setInputNeurons(dialog.getInputCount().getValue());
    som.setOutputNeurons(dialog.getOutputCount().getValue());
    return som.generate();
  }
 else   return null;
}

Fixed version (ground truth):
private static MLMethod createSOM(){
  CreateSOMDialog dialog=new CreateSOMDialog(EncogWorkBench.getInstance().getMainWindow());
  if (dialog.process()) {
    SOMPattern som=new SOMPattern();
    som.setInputNeurons(dialog.getInputCount().getValue());
    som.setOutputNeurons(dialog.getOutputCount().getValue());
    return som.generate();
  }
 else   return null;
}
Program: 17744
Project: 17744
Buggy source:
private static void createNewPopulation(File path){
  NewPopulationDialog dialog=new NewPopulationDialog();
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int inputCount=dialog.getInputNeurons().getValue();
    int outputCount=dialog.getOutputNeurons().getValue();
    NEATPopulation pop=new NEATPopulation(inputCount,outputCount,populationSize);
    pop.setNeatActivationFunction(dialog.getNeatActivationFunction());
    pop.setOutputActivationFunction(dialog.getOutputActivationFunction());
    EncogWorkBench.getInstance().save(path.toString(),pop);
    EncogWorkBench.getInstance().refresh();
  }
}

Fixed version (ground truth):
private static void createNewPopulation(File path){
  NewPopulationDialog dialog=new NewPopulationDialog();
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int inputCount=dialog.getInputNeurons().getValue();
    int outputCount=dialog.getOutputNeurons().getValue();
    NEATPopulation pop=new NEATPopulation(inputCount,outputCount,populationSize);
    pop.setNeatActivationFunction(dialog.getNeatActivationFunction());
    pop.setOutputActivationFunction(dialog.getOutputActivationFunction());
    EncogWorkBench.getInstance().save(path,pop);
    EncogWorkBench.getInstance().refresh();
  }
}
Program: 17746
Project: 17746
Buggy source:
public File getProjectDirectory(){
  String str=this.getMainWindow().getTree().getModel().getPath();
  if (str == null)   return null;
 else   return new File(str);
}

Fixed version (ground truth):
public File getProjectDirectory(){
  return this.getMainWindow().getTree().getModel().getPath();
}
Program: 17747
Project: 17747
Buggy source:
public void actionPerformed(ActionEvent e){
  if (e.getSource() == this.button) {
    if (this.save) {
      ;
      final JFileChooser fc=new JFileChooser();
      if (EncogWorkBench.getInstance().getCurrentFileName() != null)       fc.setCurrentDirectory(new File(EncogWorkBench.getInstance().getCurrentFileName()));
      fc.setFileFilter(this.filter);
      final int result=fc.showSaveDialog(this.getOwner());
      if (result == JFileChooser.APPROVE_OPTION) {
        String file=fc.getSelectedFile().getAbsolutePath();
        ((JTextField)this.getField()).setText(file);
      }
    }
 else {
      final JFileChooser fc=new JFileChooser();
      if (EncogWorkBench.getInstance().getCurrentFileName() != null)       fc.setCurrentDirectory(new File(EncogWorkBench.getInstance().getCurrentFileName()));
      fc.addChoosableFileFilter(this.filter);
      final int result=fc.showOpenDialog(this.getOwner());
      if (result == JFileChooser.APPROVE_OPTION) {
        String file=fc.getSelectedFile().getAbsolutePath();
        ((JTextField)this.getField()).setText(file);
      }
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == this.button) {
    if (this.save) {
      ;
      final JFileChooser fc=new JFileChooser();
      if (EncogWorkBench.getInstance().getProjectDirectory() != null)       fc.setCurrentDirectory(EncogWorkBench.getInstance().getProjectDirectory());
      fc.setFileFilter(this.filter);
      final int result=fc.showSaveDialog(this.getOwner());
      if (result == JFileChooser.APPROVE_OPTION) {
        String file=fc.getSelectedFile().getAbsolutePath();
        ((JTextField)this.getField()).setText(file);
      }
    }
 else {
      final JFileChooser fc=new JFileChooser();
      if (EncogWorkBench.getInstance().getProjectDirectory() != null)       fc.setCurrentDirectory(EncogWorkBench.getInstance().getProjectDirectory());
      fc.addChoosableFileFilter(this.filter);
      final int result=fc.showOpenDialog(this.getOwner());
      if (result == JFileChooser.APPROVE_OPTION) {
        String file=fc.getSelectedFile().getAbsolutePath();
        ((JTextField)this.getField()).setText(file);
      }
    }
  }
}
Program: 17748
Project: 17748
Buggy source:
public void openFile(ProjectFile file){
  try {
    EncogWorkBench.getInstance().getMainWindow().beginWait();
    EncogCommonTab tab=this.tabManager.find(file);
    if (tab == null) {
      String extension=FileUtil.getFileExt(file.getFile());
      if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new TextFileTab(file);
        this.openTab(tab);
      }
 else       if (extension.equals("String_Node_Str")) {
        tab=new EncogAnalystTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new BinaryDataTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")|| extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new ImageFileTab(file);
        this.openTab(tab);
      }
 else {
        tab=new GenericFileTab(file);
        this.openTab(tab);
      }
    }
 else {
      this.documentTabs.setSelectedComponent(tab);
      this.menus.updateMenus();
    }
  }
  finally {
    EncogWorkBench.getInstance().getMainWindow().endWait();
  }
}

Fixed version (ground truth):
public void openFile(ProjectFile file){
  try {
    EncogWorkBench.getInstance().getMainWindow().beginWait();
    EncogCommonTab tab=this.tabManager.find(file);
    if (file instanceof ProjectEGFile) {
      openEGFile((ProjectEGFile)file);
      return;
    }
    if (tab == null) {
      String extension=FileUtil.getFileExt(file.getFile());
      if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new TextFileTab(file);
        this.openTab(tab);
      }
 else       if (extension.equals("String_Node_Str")) {
        tab=new EncogAnalystTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new BinaryDataTab(file);
        this.openTab(tab);
      }
 else       if (extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str") || extension.equalsIgnoreCase("String_Node_Str")|| extension.equalsIgnoreCase("String_Node_Str")) {
        tab=new ImageFileTab(file);
        this.openTab(tab);
      }
 else {
        tab=new GenericFileTab(file);
        this.openTab(tab);
      }
    }
 else {
      this.documentTabs.setSelectedComponent(tab);
      this.menus.updateMenus();
    }
  }
  finally {
    EncogWorkBench.getInstance().getMainWindow().endWait();
  }
}
Program: 17749
Project: 17749
Buggy source:
public void openTab(EncogCommonTab tab,String title){
  int i=this.documentTabs.getTabCount();
  this.documentTabs.add(title,tab);
  if (!this.tabManager.contains(tab)) {
    if (i < this.documentTabs.getTabCount())     documentTabs.setTabComponentAt(i,new ButtonTabComponent(this,tab));
    this.tabManager.add(tab);
  }
  this.documentTabs.setSelectedComponent(tab);
  this.menus.updateMenus();
}

Fixed version (ground truth):
public void openTab(EncogCommonTab tab){
  int i=this.documentTabs.getTabCount();
  this.documentTabs.add(tab.getName(),tab);
  if (!this.tabManager.contains(tab)) {
    if (i < this.documentTabs.getTabCount())     documentTabs.setTabComponentAt(i,new ButtonTabComponent(this,tab));
    this.tabManager.add(tab);
  }
  this.documentTabs.setSelectedComponent(tab);
  this.menus.updateMenus();
}
Program: 17750
Project: 17750
Buggy source:
public void displayAboutTab(){
  this.openTab(this.aboutTab,"String_Node_Str");
}

Fixed version (ground truth):
public void displayAboutTab(){
  this.openTab(this.aboutTab);
}
Program: 17751
Project: 17751
Buggy source:
public void changeDirectory(String path){
  if (this.tabManager.getTabs().size() > 0) {
    if (!EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
      return;
    }
    this.tabManager.closeAll();
  }
  EncogWorkBench.getInstance().getMainWindow().getTree().refresh(path);
}

Fixed version (ground truth):
public void changeDirectory(File path){
  if (this.tabManager.getTabs().size() > 0) {
    if (!EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
      return;
    }
    this.tabManager.closeAll();
  }
  EncogWorkBench.getInstance().getMainWindow().getTree().refresh(path);
}
Program: 17752
Project: 17752
Buggy source:
public void redraw(){
  if (EncogWorkBench.getInstance().getCurrentFileName() == null) {
    setTitle(EncogDocumentFrame.WINDOW_TITLE + "String_Node_Str");
  }
 else {
    setTitle(EncogDocumentFrame.WINDOW_TITLE + "String_Node_Str" + EncogWorkBench.getInstance().getCurrentFileName());
  }
  getMenus().updateMenus();
  this.tree.refresh();
}

Fixed version (ground truth):
public void redraw(){
  if (EncogWorkBench.getInstance().getProjectDirectory() == null) {
    setTitle(EncogDocumentFrame.WINDOW_TITLE + "String_Node_Str");
  }
 else {
    setTitle(EncogDocumentFrame.WINDOW_TITLE + "String_Node_Str" + EncogWorkBench.getInstance().getProjectDirectory());
  }
  getMenus().updateMenus();
  this.tree.refresh();
}
Program: 17753
Project: 17753
Buggy source:
public void performFileNewProject(){
  CreateNewDocument dialog=new CreateNewDocument(EncogWorkBench.getInstance().getMainWindow());
  dialog.getParentDirectory().setValue(EncogWorkBench.getInstance().getEncogFolders().toString());
  dialog.getProjectFilename().setValue("String_Node_Str");
  if (dialog.process()) {
    File parent=new File(dialog.getParentDirectory().getValue());
    File project=new File(parent,dialog.getProjectFilename().getValue());
    Directory.deleteDirectory(project);
    project.mkdir();
    EncogWorkBench.getInstance().getMainWindow().getTree().refresh(project.toString());
    if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
      EncogAnalystWizard.createEncogAnalyst(null);
    }
  }
}

Fixed version (ground truth):
public void performFileNewProject(){
  CreateNewDocument dialog=new CreateNewDocument(EncogWorkBench.getInstance().getMainWindow());
  dialog.getParentDirectory().setValue(EncogWorkBench.getInstance().getEncogFolders().toString());
  dialog.getProjectFilename().setValue("String_Node_Str");
  if (dialog.process()) {
    File parent=new File(dialog.getParentDirectory().getValue());
    File project=new File(parent,dialog.getProjectFilename().getValue());
    Directory.deleteDirectory(project);
    project.mkdir();
    EncogWorkBench.getInstance().getMainWindow().getTree().refresh(project);
    if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
      EncogAnalystWizard.createEncogAnalyst(null);
    }
  }
}
Program: 17754
Project: 17754
Buggy source:
public void performRBF(){
  RadialBasisFunctionsTab rbf=new RadialBasisFunctionsTab();
  this.owner.openTab(rbf,"String_Node_Str");
}

Fixed version (ground truth):
public void performRBF(){
  RadialBasisFunctionsTab rbf=new RadialBasisFunctionsTab();
  this.owner.openTab(rbf);
}
Program: 17755
Project: 17755
Buggy source:
public void performFileChooseDirectory(){
  try {
    final JFileChooser fc=new JFileChooser();
    fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    fc.setCurrentDirectory(EncogWorkBench.getInstance().getEncogFolders());
    final int result=fc.showOpenDialog(owner);
    if (result == JFileChooser.APPROVE_OPTION) {
      String path=fc.getSelectedFile().getAbsolutePath();
      EncogWorkBench.getInstance().getMainWindow().changeDirectory(path);
    }
  }
 catch (  final Throwable e) {
    EncogWorkBench.displayError("String_Node_Str",e);
    e.printStackTrace();
    EncogWorkBench.getInstance().getMainWindow().endWait();
  }
}

Fixed version (ground truth):
public void performFileChooseDirectory(){
  try {
    final JFileChooser fc=new JFileChooser();
    fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    fc.setCurrentDirectory(EncogWorkBench.getInstance().getEncogFolders());
    final int result=fc.showOpenDialog(owner);
    if (result == JFileChooser.APPROVE_OPTION) {
      File path=fc.getSelectedFile().getAbsoluteFile();
      EncogWorkBench.getInstance().getMainWindow().changeDirectory(path);
    }
  }
 catch (  final Throwable e) {
    EncogWorkBench.displayError("String_Node_Str",e);
    e.printStackTrace();
    EncogWorkBench.getInstance().getMainWindow().endWait();
  }
}
Program: 17756
Project: 17756
Buggy source:
public void performBrowse(){
  BrowserFrame browse=new BrowserFrame();
  this.owner.openTab(browse,"String_Node_Str" + (browser++));
}

Fixed version (ground truth):
public void performBrowse(){
  BrowserFrame browse=new BrowserFrame();
  this.owner.openTab(browse);
}
Program: 17757
Project: 17757
Buggy source:
public void updateMenus(){
  boolean modal=this.owner.isModalTabOpen();
  boolean supportsClipboard=false;
  boolean documentOpen=EncogWorkBench.getInstance().getCurrentFileName() != null;
  JTabbedPane tabs=EncogWorkBench.getInstance().getMainWindow().getDocumentTabs();
  EncogCommonTab currentTab=(EncogCommonTab)tabs.getSelectedComponent();
  this.menuFileNew.setEnabled(!modal && documentOpen);
  this.menuFileQuit.setEnabled(true);
  this.menuEditCut.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditCopy.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditPaste.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditConfig.setEnabled(!modal);
  this.menuToolsTrain.setEnabled(!modal && documentOpen);
  this.menuToolsGenerate.setEnabled(!modal && documentOpen);
  this.menuToolsEvaluate.setEnabled(!modal && documentOpen);
  this.menuToolsBenchmark.setEnabled(!modal);
  this.menuToolsBrowse.setEnabled(!modal);
  this.menuToolsValidation.setEnabled(!modal && documentOpen);
  this.menuHelpAbout.setEnabled(!modal);
}

Fixed version (ground truth):
public void updateMenus(){
  boolean modal=this.owner.isModalTabOpen();
  boolean supportsClipboard=false;
  boolean documentOpen=EncogWorkBench.getInstance().getProjectDirectory() != null;
  JTabbedPane tabs=EncogWorkBench.getInstance().getMainWindow().getDocumentTabs();
  EncogCommonTab currentTab=(EncogCommonTab)tabs.getSelectedComponent();
  this.menuFileNew.setEnabled(!modal && documentOpen);
  this.menuFileQuit.setEnabled(true);
  this.menuEditCut.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditCopy.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditPaste.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditConfig.setEnabled(!modal);
  this.menuToolsTrain.setEnabled(!modal && documentOpen);
  this.menuToolsGenerate.setEnabled(!modal && documentOpen);
  this.menuToolsEvaluate.setEnabled(!modal && documentOpen);
  this.menuToolsBenchmark.setEnabled(!modal);
  this.menuToolsBrowse.setEnabled(!modal);
  this.menuToolsValidation.setEnabled(!modal && documentOpen);
  this.menuHelpAbout.setEnabled(!modal);
}
Program: 17758
Project: 17758
Buggy source:
public int getIndexOfChild(Object parent,Object child){
  if (parent == path) {
    return this.files.indexOf(child);
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
public int getIndexOfChild(Object parent,Object child){
  if (parent == projectDirectory.getParent()) {
    return this.files.indexOf(child);
  }
 else {
    return -1;
  }
}
Program: 17759
Project: 17759
Buggy source:
public Object getChild(Object parent,int index){
  if (parent == path) {
    return this.files.get(index);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Object getChild(Object parent,int index){
  if (parent == projectDirectory.getParent()) {
    return this.files.get(index);
  }
 else {
    return null;
  }
}
Program: 17760
Project: 17760
Buggy source:
public void invalidate(){
  invalidate(this.path);
}

Fixed version (ground truth):
public void invalidate(){
  invalidate(getPath());
}
Program: 17761
Project: 17761
Buggy source:
public boolean isLeaf(Object node){
  if (node == path) {
    return false;
  }
 else {
    if (node instanceof ProjectDirectory) {
      return false;
    }
 else     if (node instanceof ProjectEGFile) {
      return false;
    }
 else     if (node instanceof ProjectFile) {
      return true;
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean isLeaf(Object node){
  if (node == projectDirectory.getParent()) {
    return false;
  }
 else {
    if (node instanceof ProjectDirectory) {
      return false;
    }
 else     if (node instanceof ProjectEGFile) {
      return true;
    }
 else     if (node instanceof ProjectFile) {
      return true;
    }
    return true;
  }
}
Program: 17762
Project: 17762
Buggy source:
public int getChildCount(Object parent){
  if (parent == path) {
    return this.files.size();
  }
 else {
    return 0;
  }
}

Fixed version (ground truth):
public int getChildCount(Object parent){
  if (parent == projectDirectory.getParent()) {
    return this.files.size();
  }
 else {
    return 0;
  }
}
Program: 17763
Project: 17763
Buggy source:
public String getPath(){
  return this.path;
}

Fixed version (ground truth):
public File getPath(){
  if (this.projectDirectory == null)   return null;
 else   return this.projectDirectory.getParent();
}
Program: 17764
Project: 17764
Buggy source:
public Object getRoot(){
  return path;
}

Fixed version (ground truth):
public Object getRoot(){
  if (projectDirectory == null)   return null;
 else   return projectDirectory.getParent();
}
Program: 17765
Project: 17765
Buggy source:
public static void handleError(Throwable t,MLMethod network,NeuralDataSet training){
  t.printStackTrace();
  ErrorDialog dialog=new ErrorDialog(EncogWorkBench.getInstance().getMainWindow(),t,network,training);
  dialog.process();
  EncogWorkBench.getInstance().getMainWindow().endWait();
}

Fixed version (ground truth):
public static void handleError(Throwable t,ProjectFile network,NeuralDataSet training){
  t.printStackTrace();
  ErrorDialog dialog=new ErrorDialog(EncogWorkBench.getInstance().getMainWindow(),t,network,training);
  dialog.process();
  EncogWorkBench.getInstance().getMainWindow().endWait();
}
Program: 17767
Project: 17767
Buggy source:
public GeneralPopulationModel(Population population){
  this.population=population;
}

Fixed version (ground truth):
public GeneralPopulationModel(NEATPopulation population){
  this.population=population;
}
Program: 17768
Project: 17768
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  Genome genome=this.population.getGenomes().get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)genome.getGenomeID());
case 1:
  return Format.formatInteger(genome.getChromosomes().size());
case 2:
return Format.formatDouble(genome.getAmountToSpawn(),2);
case 3:
return Format.formatDouble(genome.getScore(),4);
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  NEATGenome genome=(NEATGenome)this.population.getGenomes().get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)genome.getGenomeID());
case 1:
  return Format.formatInteger(genome.getNeurons().size());
case 2:
return Format.formatInteger(genome.getLinks().size());
case 3:
return Format.formatDouble(genome.getAmountToSpawn(),2);
case 4:
return Format.formatDouble(genome.getScore(),4);
default :
return "String_Node_Str";
}
}
Program: 17770
Project: 17770
Buggy source:
public void actionPerformed(final ActionEvent e){
  if (e.getSource() == this.calculateButton) {
    try {
      setDirty(true);
      final BasicNeuralData input=new BasicNeuralData(this.inputCount);
      for (int i=0; i < this.inputCount; i++) {
        double value=0;
        final String str=(String)this.inputTable.getValueAt(i,1);
        try {
          value=Double.parseDouble(str);
        }
 catch (        final NumberFormatException e2) {
          EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
        }
        input.setData(i,value);
      }
      final int output=getData().classify(input);
      this.outputTable.setValueAt(output,0,1);
    }
 catch (    EncogError ex) {
      EncogWorkBench.displayError("String_Node_Str",ex.getMessage());
    }
catch (    Throwable t) {
      ErrorDialog.handleError(t,(MLMethod)this.getEncogObject(),null);
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(final ActionEvent e){
  if (e.getSource() == this.calculateButton) {
    try {
      setDirty(true);
      final BasicNeuralData input=new BasicNeuralData(this.inputCount);
      for (int i=0; i < this.inputCount; i++) {
        double value=0;
        final String str=(String)this.inputTable.getValueAt(i,1);
        try {
          value=Double.parseDouble(str);
        }
 catch (        final NumberFormatException e2) {
          EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
        }
        input.setData(i,value);
      }
      final int output=getData().classify(input);
      this.outputTable.setValueAt(output,0,1);
    }
 catch (    EncogError ex) {
      EncogWorkBench.displayError("String_Node_Str",ex.getMessage());
    }
catch (    Throwable t) {
      ErrorDialog.handleError(t,this.getEncogObject(),null);
    }
  }
}