nus-yam/ex-repair huggingface dataset:
Program: 17641
Project: 17641
Buggy source:
public void changeEquation(){
  boolean der=this.derivative.isSelected();
  ActivationFunction newActivation=null;
switch (this.select.getSelectedIndex()) {
case 0:
    newActivation=new ActivationBiPolar();
  break;
case 1:
newActivation=new ActivationCompetitive();
break;
case 2:
newActivation=new ActivationGaussian(0,1);
break;
case 3:
newActivation=new ActivationLinear();
break;
case 4:
newActivation=new ActivationLOG();
break;
case 5:
newActivation=new ActivationSigmoid();
break;
case 6:
newActivation=new ActivationSIN();
break;
case 7:
newActivation=new ActivationSoftMax();
break;
case 8:
newActivation=new ActivationStep();
break;
case 9:
newActivation=new ActivationTANH();
break;
case 10:
newActivation=new ActivationRamp();
break;
case 11:
newActivation=new ActivationElliott();
break;
case 12:
newActivation=new ActivationElliottSymmetric();
break;
case 13:
newActivation=new ActivationSteepenedSigmoid();
break;
}
if (this.activation.getClass() != newActivation.getClass()) {
this.activation=newActivation;
}
this.equation.setupEquation(newActivation,!der);
this.params.setEnabled(this.activation.getParams().length > 0);
}

Fixed version (ground truth):
public void changeEquation(){
  boolean der=this.derivative.isSelected();
  ActivationFunction newActivation=null;
switch (this.select.getSelectedIndex()) {
case 0:
    newActivation=new ActivationBiPolar();
  break;
case 1:
newActivation=new ActivationCompetitive();
break;
case 2:
newActivation=new ActivationGaussian();
break;
case 3:
newActivation=new ActivationLinear();
break;
case 4:
newActivation=new ActivationLOG();
break;
case 5:
newActivation=new ActivationSigmoid();
break;
case 6:
newActivation=new ActivationSIN();
break;
case 7:
newActivation=new ActivationSoftMax();
break;
case 8:
newActivation=new ActivationStep();
break;
case 9:
newActivation=new ActivationTANH();
break;
case 10:
newActivation=new ActivationRamp();
break;
case 11:
newActivation=new ActivationElliott();
break;
case 12:
newActivation=new ActivationElliottSymmetric();
break;
case 13:
newActivation=new ActivationSteepenedSigmoid();
break;
}
if (this.activation.getClass() != newActivation.getClass()) {
this.activation=newActivation;
}
this.equation.setupEquation(newActivation,!der);
this.params.setEnabled(this.activation.getParams().length > 0);
}
Program: 17644
Project: 17644
Buggy source:
public void updateMenus(){
  boolean modal=this.owner.getTabManager().isModalTabOpen();
  boolean documentOpen=EncogWorkBench.getInstance().getProjectDirectory() != null;
  JTabbedPane tabs=this.owner.getTabManager().getDocumentTabs();
  EncogCommonTab currentTab=(EncogCommonTab)tabs.getSelectedComponent();
  boolean supportsClipboard=currentTab instanceof SupportsClipboard;
  this.menuFileNew.setEnabled(!modal && documentOpen);
  this.menuFileChangeDir.setEnabled(!modal);
  this.menuFileNewProject.setEnabled(!modal);
  this.menuFileQuit.setEnabled(true);
  this.menuFileImport.setEnabled(!modal && documentOpen);
  this.menuFileSeve.setEnabled(!modal && documentOpen && currentTab != null);
  this.menuEditCut.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditCopy.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditPaste.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditConfig.setEnabled(!modal);
  this.menuViewRBF.setEnabled(!modal);
  this.menuToolsTrain.setEnabled(!modal && documentOpen);
  this.menuToolsGenerate.setEnabled(!modal && documentOpen);
  this.menuToolsEvaluate.setEnabled(!modal && documentOpen);
  this.menuToolsBenchmark.setEnabled(!modal);
  this.menuToolsValidation.setEnabled(!modal && documentOpen);
  this.menuToolsExt2Bin.setEnabled(!modal);
  this.menuToolsBin2Ext.setEnabled(!modal);
  this.menuToolsWizard.setEnabled(!modal && documentOpen);
  this.menuHelpAbout.setEnabled(!modal);
}

Fixed version (ground truth):
public void updateMenus(){
  boolean modal=this.owner.getTabManager().isModalTabOpen();
  boolean documentOpen=EncogWorkBench.getInstance().getProjectDirectory() != null;
  JTabbedPane tabs=this.owner.getTabManager().getDocumentTabs();
  EncogCommonTab currentTab=(EncogCommonTab)tabs.getSelectedComponent();
  boolean supportsClipboard=currentTab instanceof SupportsClipboard;
  this.menuFileNew.setEnabled(!modal && documentOpen);
  this.menuFileChangeDir.setEnabled(!modal);
  this.menuFileNewProject.setEnabled(!modal);
  this.menuFileQuit.setEnabled(true);
  this.menuFileImport.setEnabled(!modal && documentOpen);
  this.menuFileSeve.setEnabled(!modal && documentOpen && currentTab != null);
  this.menuEditCut.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditCopy.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditPaste.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditSelectAll.setEnabled(!modal && supportsClipboard && documentOpen);
  this.menuEditConfig.setEnabled(!modal);
  this.menuViewRBF.setEnabled(!modal);
  this.menuToolsTrain.setEnabled(!modal && documentOpen);
  this.menuToolsGenerate.setEnabled(!modal && documentOpen);
  this.menuToolsEvaluate.setEnabled(!modal && documentOpen);
  this.menuToolsBenchmark.setEnabled(!modal);
  this.menuToolsValidation.setEnabled(!modal && documentOpen);
  this.menuToolsExt2Bin.setEnabled(!modal);
  this.menuToolsBin2Ext.setEnabled(!modal);
  this.menuToolsWizard.setEnabled(!modal && documentOpen);
  this.menuHelpAbout.setEnabled(!modal);
}
Program: 17646
Project: 17646
Buggy source:
public void find(){
  try {
    String editorText=this.editor.getDocument().getText(0,this.editor.getDocument().getLength());
    String text=EncogWorkBench.displayInput("String_Node_Str");
    if (text != null) {
      int start=this.editor.getCaretPosition();
      int idx=editorText.indexOf(text,start);
      if (idx == -1) {
        EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      }
 else {
        this.editor.setSelectionStart(idx);
        this.editor.setSelectionEnd(idx + text.length());
      }
    }
  }
 catch (  BadLocationException ex) {
  }
}

Fixed version (ground truth):
public void find(){
  try {
    String editorText=this.editor.getDocument().getText(0,this.editor.getDocument().getLength());
    String text=EncogWorkBench.displayInput("String_Node_Str");
    if (text != null) {
      int start=this.editor.getCaretPosition();
      int idx=editorText.indexOf(text,start);
      if (idx == -1) {
        EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      }
 else {
        this.editor.requestFocusInWindow();
        this.editor.setSelectionStart(idx);
        this.editor.setSelectionEnd(idx + text.length());
      }
    }
  }
 catch (  BadLocationException ex) {
  }
}
Program: 17647
Project: 17647
Buggy source:
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.theType=NeuralNetworkType.EncogFactoryCode;
  break;
case 1:
this.theType=NeuralNetworkType.Automatic;
break;
case 2:
this.theType=NeuralNetworkType.ADALINE;
break;
case 3:
this.theType=NeuralNetworkType.ART1;
break;
case 4:
this.theType=NeuralNetworkType.BayesianNetwork;
break;
case 6:
this.theType=NeuralNetworkType.BAM;
break;
case 7:
this.theType=NeuralNetworkType.Boltzmann;
break;
case 8:
this.theType=NeuralNetworkType.CPN;
break;
case 9:
this.theType=NeuralNetworkType.Feedforward;
break;
case 10:
this.theType=NeuralNetworkType.RBF;
break;
case 11:
this.theType=NeuralNetworkType.SOM;
break;
case 12:
this.theType=NeuralNetworkType.Hopfield;
break;
case 13:
this.theType=NeuralNetworkType.PNN;
break;
case 14:
this.theType=NeuralNetworkType.Elman;
break;
case 15:
this.theType=NeuralNetworkType.Jordan;
break;
case 16:
this.theType=NeuralNetworkType.SVM;
break;
}
}

Fixed version (ground truth):
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.theType=NeuralNetworkType.EncogFactoryCode;
  break;
case 1:
this.theType=NeuralNetworkType.Automatic;
break;
case 2:
this.theType=NeuralNetworkType.ADALINE;
break;
case 3:
this.theType=NeuralNetworkType.ART1;
break;
case 4:
this.theType=NeuralNetworkType.BayesianNetwork;
break;
case 5:
this.theType=NeuralNetworkType.BAM;
break;
case 6:
this.theType=NeuralNetworkType.Boltzmann;
break;
case 7:
this.theType=NeuralNetworkType.CPN;
break;
case 8:
this.theType=NeuralNetworkType.Feedforward;
break;
case 9:
this.theType=NeuralNetworkType.RBF;
break;
case 10:
this.theType=NeuralNetworkType.SOM;
break;
case 11:
this.theType=NeuralNetworkType.Hopfield;
break;
case 12:
this.theType=NeuralNetworkType.PNN;
break;
case 13:
this.theType=NeuralNetworkType.Elman;
break;
case 14:
this.theType=NeuralNetworkType.Jordan;
break;
case 15:
this.theType=NeuralNetworkType.SVM;
break;
}
}
Program: 17648
Project: 17648
Buggy source:
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";
}
}

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.getNeuronsChromosome().size());
case 2:
return Format.formatInteger(genome.getLinksChromosome().size());
case 3:
return Format.formatDouble(genome.getAmountToSpawn(),2);
case 4:
return Format.formatDouble(genome.getScore(),4);
default :
return "String_Node_Str";
}
}
Program: 17650
Project: 17650
Buggy source:
public List<String> getSourceData(){
  DefaultListModel<String> ctrl=this.sourceData.getModel();
  List<String> result=new ArrayList<String>();
  for (int i=0; i < ctrl.getSize(); i++) {
    result.add(ctrl.get(i));
  }
  return result;
}

Fixed version (ground truth):
public List<String> getSourceData(){
  DefaultListModel ctrl=this.sourceData.getModel();
  List<String> result=new ArrayList<String>();
  for (int i=0; i < ctrl.getSize(); i++) {
    result.add(ctrl.get(i).toString());
  }
  return result;
}
Program: 17651
Project: 17651
Buggy source:
public List<String> getSourceData(){
  DefaultListModel<String> ctrl=this.sourceData.getModel();
  List<String> result=new ArrayList<String>();
  for (int i=0; i < ctrl.getSize(); i++) {
    result.add(ctrl.get(i));
  }
  return result;
}

Fixed version (ground truth):
public List<String> getSourceData(){
  DefaultListModel ctrl=this.sourceData.getModel();
  List<String> result=new ArrayList<String>();
  for (int i=0; i < ctrl.getSize(); i++) {
    result.add(ctrl.get(i).toString());
  }
  return result;
}
Program: 17652
Project: 17652
Buggy source:
@Override public void notifyConnections(IndicatorLink link,boolean hasOpened){
  if (hasOpened && mylink == null) {
    this.mylink=link;
    this.mylink.requestSignal(this.dataSource);
  }
 else   if (!hasOpened && link == this.mylink) {
    this.close();
    this.dispose();
  }
}

Fixed version (ground truth):
@Override public void notifyConnections(IndicatorLink link,boolean hasOpened){
  if (hasOpened && mylink == null) {
    this.mylink=link;
    this.mylink.initConnection(this.dataSource,false);
  }
 else   if (!hasOpened && link == this.mylink) {
    this.close();
    this.dispose();
  }
}
Program: 17653
Project: 17653
Buggy source:
public void run(){
  try {
    this.loader.setStatus(this);
    if (performImport)     this.loader.external2Binary(binaryFile);
 else     this.loader.binary2External(binaryFile);
    dispose();
    if (performImport)     EncogWorkBench.displayMessage("String_Node_Str","String_Node_Str");
 else     EncogWorkBench.displayMessage("String_Node_Str","String_Node_Str");
    if (this.done != null) {
      done.complete();
    }
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t);
  }
 finally {
    EncogWorkBench.getInstance().getMainWindow().getTree().refresh();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    this.loader.setStatus(this);
    if (performImport)     this.loader.external2Binary(binaryFile);
 else     this.loader.binary2External(binaryFile);
    dispose();
    EncogWorkBench.displayMessage("String_Node_Str","String_Node_Str");
    if (this.done != null) {
      done.complete();
    }
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t);
  }
 finally {
    EncogWorkBench.getInstance().getMainWindow().getTree().refresh();
  }
}
Program: 17654
Project: 17654
Buggy source:
public void actionPerformed(ActionEvent e){
  if (e.getSource() == this.buttonClear) {
    this.text.setText("String_Node_Str");
  }
 else   if (e.getSource() == this.comboLogLevel) {
    String level=(String)this.comboLogLevel.getSelectedItem();
    output("String_Node_Str" + level);
    int l=EncogLogging.LEVEL_DISABLE;
    if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_DISABLE;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_CRITICAL;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_ERROR;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_INFO;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_DEBUG;
    }
    ((WorkbenchLogging)Encog.getInstance().getLoggingPlugin()).setLogLevel(l);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == this.buttonClear) {
    this.text.setText("String_Node_Str");
  }
 else   if (e.getSource() == this.comboLogLevel) {
    String level=(String)this.comboLogLevel.getSelectedItem();
    outputLine("String_Node_Str" + level);
    int l=EncogLogging.LEVEL_DISABLE;
    if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_DISABLE;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_CRITICAL;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_ERROR;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_INFO;
    }
 else     if (level.equals("String_Node_Str")) {
      l=EncogLogging.LEVEL_DEBUG;
    }
    ((WorkbenchLogging)Encog.getInstance().getLoggingPlugin()).setLogLevel(l);
  }
}
Program: 17655
Project: 17655
Buggy source:
public void beginAccepting(){
  if (this.cloudNode != null) {
    stopAccepting();
  }
  this.cloudNode=new IndicatorServer(this.config.getPort());
  this.cloudNode.start();
  this.cloudNode.addListener(EncogWorkBench.getInstance().getMainWindow().getConnectionsTab().getModel());
  this.outputLine("String_Node_Str" + this.config.getPort());
}

Fixed version (ground truth):
public void beginAccepting(){
  if (this.cloudNode != null) {
    stopAccepting();
  }
  this.cloudNode=new IndicatorServer(this.config.getPort());
  this.cloudNode.start();
  this.cloudNode.addListener((IndicatorConnectionListener)EncogWorkBench.getInstance().getMainWindow().getConnectionsTab().getModel());
  this.outputLine("String_Node_Str" + this.config.getPort());
}
Program: 17656
Project: 17656
Buggy source:
public EncogConfigDialog(Frame owner){
  super(owner);
  List<String> errorMethods=new ArrayList<String>();
  errorMethods.add("String_Node_Str");
  errorMethods.add("String_Node_Str");
  setTitle("String_Node_Str");
  setSize(500,300);
  beginTab("String_Node_Str");
  addProperty(this.defaultError=new DoubleField("String_Node_Str","String_Node_Str",true,0,100));
  addProperty(this.errorCalculation=new ComboBoxField("String_Node_Str","String_Node_Str",true,errorMethods));
  addProperty(this.threadCount=new IntegerField("String_Node_Str","String_Node_Str",true,0,10000));
  addProperty(this.trainingChartHistory=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.iterationStepCount=new IntegerField("String_Node_Str","String_Node_Str",true,1,1000));
  addProperty(this.displayTrainingImprovement=new CheckField("String_Node_Str","String_Node_Str"));
  render();
}

Fixed version (ground truth):
public EncogConfigDialog(Frame owner){
  super(owner);
  List<String> errorMethods=new ArrayList<String>();
  errorMethods.add("String_Node_Str");
  errorMethods.add("String_Node_Str");
  setTitle("String_Node_Str");
  setSize(500,300);
  beginTab("String_Node_Str");
  addProperty(this.defaultError=new DoubleField("String_Node_Str","String_Node_Str",true,0,100));
  addProperty(this.errorCalculation=new ComboBoxField("String_Node_Str","String_Node_Str",true,errorMethods));
  addProperty(this.threadCount=new IntegerField("String_Node_Str","String_Node_Str",true,0,10000));
  addProperty(this.trainingChartHistory=new IntegerField("String_Node_Str","String_Node_Str",true,-1,Integer.MAX_VALUE));
  addProperty(this.iterationStepCount=new IntegerField("String_Node_Str","String_Node_Str",true,1,1000));
  addProperty(this.displayTrainingImprovement=new CheckField("String_Node_Str","String_Node_Str"));
  render();
}
Program: 17657
Project: 17657
Buggy source:
/** 
 * Construct the pane.
 */
public ChartPane(boolean trackValidation){
  int historySize=EncogWorkBench.getInstance().getConfig().getTrainingHistory();
  this.trackValidation=trackValidation;
  this.trackImprovement=EncogWorkBench.getInstance().getConfig().isShowTrainingImprovement();
  this.series1=new XYSeries("String_Node_Str");
  this.dataset1=new XYSeriesCollection();
  this.dataset1.addSeries(this.series1);
  if (historySize > 0) {
    this.series1.setMaximumItemCount(Math.min(historySize,100));
  }
  if (trackImprovement) {
    this.series2=new XYSeries("String_Node_Str");
    this.dataset2=new XYSeriesCollection();
    this.dataset2.addSeries(this.series2);
    this.series2.setMaximumItemCount(historySize);
  }
  if (trackValidation) {
    this.series3=new XYSeries("String_Node_Str");
    this.dataset3=new XYSeriesCollection();
    this.dataset3.addSeries(this.series3);
    if (historySize > 0) {
      this.series3.setMaximumItemCount(Math.min(historySize,100));
    }
  }
  final JFreeChart chart=createChart();
  this.chartPanel=new ChartPanel(chart);
  this.chartPanel.setPreferredSize(new java.awt.Dimension(600,270));
  this.chartPanel.setDomainZoomable(true);
  this.chartPanel.setRangeZoomable(true);
  setLayout(new BorderLayout());
  add(this.chartPanel,BorderLayout.CENTER);
}

Fixed version (ground truth):
/** 
 * Construct the pane.
 */
public ChartPane(boolean trackValidation){
  int historySize=EncogWorkBench.getInstance().getConfig().getTrainingHistory();
  this.trackValidation=trackValidation;
  this.trackImprovement=EncogWorkBench.getInstance().getConfig().isShowTrainingImprovement();
  this.series1=new XYSeries("String_Node_Str");
  this.dataset1=new XYSeriesCollection();
  this.dataset1.addSeries(this.series1);
  if (historySize > 0) {
    this.series1.setMaximumItemCount(Math.min(historySize,100));
  }
  if (trackImprovement) {
    this.series2=new XYSeries("String_Node_Str");
    this.dataset2=new XYSeriesCollection();
    this.dataset2.addSeries(this.series2);
    if (historySize > 0) {
      this.series2.setMaximumItemCount(Math.min(historySize,100));
    }
  }
  if (trackValidation) {
    this.series3=new XYSeries("String_Node_Str");
    this.dataset3=new XYSeriesCollection();
    this.dataset3.addSeries(this.series3);
    if (historySize > 0) {
      this.series3.setMaximumItemCount(Math.min(historySize,100));
    }
  }
  final JFreeChart chart=createChart();
  this.chartPanel=new ChartPanel(chart);
  this.chartPanel.setPreferredSize(new java.awt.Dimension(600,270));
  this.chartPanel.setDomainZoomable(true);
  this.chartPanel.setRangeZoomable(true);
  setLayout(new BorderLayout());
  add(this.chartPanel,BorderLayout.CENTER);
}
Program: 17658
Project: 17658
Buggy source:
private void performCopy(ProjectFile selected){
  try {
    File t=FileUtil.addFilenameBase(selected.getFile(),"String_Node_Str");
    String targetStr;
    if ((targetStr=EncogWorkBench.displayInput("String_Node_Str",t.getName())) != null) {
      File targetFile=new File(EncogWorkBench.getInstance().getProjectDirectory(),new File(targetStr).getName());
      if (targetFile.exists()) {
        if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
          FileUtil.copy(selected.getFile(),targetFile);
        }
      }
      EncogWorkBench.getInstance().getMainWindow().redraw();
    }
  }
 catch (  Exception ex) {
    EncogWorkBench.displayError("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private void performCopy(ProjectFile selected){
  try {
    File t=FileUtil.addFilenameBase(selected.getFile(),"String_Node_Str");
    String targetStr;
    if ((targetStr=EncogWorkBench.displayInput("String_Node_Str",t.getName())) != null) {
      File targetFile=new File(EncogWorkBench.getInstance().getProjectDirectory(),new File(targetStr).getName());
      if (targetFile.exists()) {
        if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
          FileUtil.copy(selected.getFile(),targetFile);
        }
      }
 else {
        FileUtil.copy(selected.getFile(),targetFile);
      }
      EncogWorkBench.getInstance().getMainWindow().redraw();
    }
  }
 catch (  Exception ex) {
    EncogWorkBench.displayError("String_Node_Str",ex);
  }
}
Program: 17659
Project: 17659
Buggy source:
private void performSVMSearch(ProjectEGFile file,MLDataSet trainingData,MLDataSet validationData){
  InputSearchSVM dialog=new InputSearchSVM();
  SVM method=(SVM)file.getObject();
  dialog.getBeginningGamma().setValue(SVMTrain.DEFAULT_GAMMA_BEGIN);
  dialog.getEndingGamma().setValue(SVMTrain.DEFAULT_GAMMA_END);
  dialog.getStepGamma().setValue(SVMTrain.DEFAULT_GAMMA_STEP);
  dialog.getBeginningC().setValue(SVMTrain.DEFAULT_CONST_BEGIN);
  dialog.getEndingC().setValue(SVMTrain.DEFAULT_CONST_END);
  dialog.getStepC().setValue(SVMTrain.DEFAULT_CONST_STEP);
  if (dialog.process()) {
    double maxError=dialog.getMaxError().getValue() / 100.0;
    SVMSearchTrain train=new SVMSearchTrain(method,trainingData);
    train.setGammaBegin(dialog.getBeginningGamma().getValue());
    train.setGammaEnd(dialog.getEndingGamma().getValue());
    train.setGammaStep(dialog.getStepGamma().getValue());
    train.setConstBegin(dialog.getBeginningC().getValue());
    train.setConstEnd(dialog.getEndingC().getValue());
    train.setConstStep(dialog.getStepC().getValue());
    EngineConcurrency.getInstance().setThreadCount(dialog.getThreadCount().getValue());
    startup(file,train,maxError,validationData);
  }
}

Fixed version (ground truth):
private void performSVMSearch(ProjectEGFile file,MLDataSet trainingData,MLDataSet validationData){
  InputSearchSVM dialog=new InputSearchSVM();
  SVM method=(SVM)file.getObject();
  dialog.getBeginningGamma().setValue(SVMSearchTrain.DEFAULT_GAMMA_BEGIN);
  dialog.getEndingGamma().setValue(SVMSearchTrain.DEFAULT_GAMMA_END);
  dialog.getStepGamma().setValue(SVMSearchTrain.DEFAULT_GAMMA_STEP);
  dialog.getBeginningC().setValue(SVMSearchTrain.DEFAULT_CONST_BEGIN);
  dialog.getEndingC().setValue(SVMSearchTrain.DEFAULT_CONST_END);
  dialog.getStepC().setValue(SVMSearchTrain.DEFAULT_CONST_STEP);
  if (dialog.process()) {
    double maxError=dialog.getMaxError().getValue() / 100.0;
    SVMSearchTrain train=new SVMSearchTrain(method,trainingData);
    train.setGammaBegin(dialog.getBeginningGamma().getValue());
    train.setGammaEnd(dialog.getEndingGamma().getValue());
    train.setGammaStep(dialog.getStepGamma().getValue());
    train.setConstBegin(dialog.getBeginningC().getValue());
    train.setConstEnd(dialog.getEndingC().getValue());
    train.setConstStep(dialog.getStepC().getValue());
    EngineConcurrency.getInstance().setThreadCount(dialog.getThreadCount().getValue());
    startup(file,train,maxError,validationData);
  }
}
Program: 17662
Project: 17662
Buggy source:
public void find(){
  String text=EncogWorkBench.displayInput("String_Node_Str");
  if (text != null) {
    int start=this.editor.getCaretPosition();
    int idx=this.getText().indexOf(text,start);
    if (idx == -1) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
    }
 else {
      this.editor.setSelectionStart(idx);
      this.editor.setSelectionEnd(idx + text.length());
    }
  }
}

Fixed version (ground truth):
public void find(){
  try {
    String editorText=this.editor.getDocument().getText(0,this.editor.getDocument().getLength());
    String text=EncogWorkBench.displayInput("String_Node_Str");
    if (text != null) {
      int start=this.editor.getCaretPosition();
      int idx=editorText.indexOf(text,start);
      if (idx == -1) {
        EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      }
 else {
        this.editor.setSelectionStart(idx);
        this.editor.setSelectionEnd(idx + text.length());
      }
    }
  }
 catch (  BadLocationException ex) {
  }
}
Program: 17663
Project: 17663
Buggy source:
public void loadConfig(){
  try {
    String home=System.getProperty("String_Node_Str");
    File file=new File(home,EncogWorkBench.CONFIG_FILENAME);
    InputStream is=new FileInputStream(file);
    EncogReadHelper in=new EncogReadHelper(is);
    EncogFileSection section;
    while ((section=in.readNextSection()) != null) {
      if (section.getSectionName().equals("String_Node_Str") && section.getSubSectionName().equals("String_Node_Str")) {
        Map<String,EncogFileLine> params=section.parseParams();
        this.defaultError=EncogFileSection.parseDouble(params,EncogWorkBenchConfig.PROPERTY_DEFAULT_ERROR);
        this.threadCount=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT);
        this.useOpenCL=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT) > 0;
        this.errorCalculation=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_ERROR_CALC);
      }
    }
    is.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void loadConfig(){
  try {
    String home=System.getProperty("String_Node_Str");
    File file=new File(home,EncogWorkBench.CONFIG_FILENAME);
    InputStream is=new FileInputStream(file);
    EncogReadHelper in=new EncogReadHelper(is);
    EncogFileSection section;
    while ((section=in.readNextSection()) != null) {
      if (section.getSectionName().equals("String_Node_Str") && section.getSubSectionName().equals("String_Node_Str")) {
        Map<String,String> params=section.parseParams();
        this.defaultError=EncogFileSection.parseDouble(params,EncogWorkBenchConfig.PROPERTY_DEFAULT_ERROR);
        this.threadCount=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT);
        this.useOpenCL=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT) > 0;
        this.errorCalculation=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_ERROR_CALC);
      }
    }
    is.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17664
Project: 17664
Buggy source:
public void loadConfig(){
  try {
    String home=System.getProperty("String_Node_Str");
    File file=new File(home,EncogWorkBench.CONFIG_FILENAME);
    InputStream is=new FileInputStream(file);
    EncogReadHelper in=new EncogReadHelper(is);
    EncogFileSection section;
    while ((section=in.readNextSection()) != null) {
      if (section.getSectionName().equals("String_Node_Str") && section.getSubSectionName().equals("String_Node_Str")) {
        Map<String,String> params=section.parseParams();
        this.defaultError=EncogFileSection.parseDouble(params,EncogWorkBenchConfig.PROPERTY_DEFAULT_ERROR);
        this.threadCount=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT);
        this.useOpenCL=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT) > 0;
        this.errorCalculation=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_ERROR_CALC);
      }
    }
    is.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void loadConfig(){
  try {
    String home=System.getProperty("String_Node_Str");
    File file=new File(home,EncogWorkBench.CONFIG_FILENAME);
    InputStream is=new FileInputStream(file);
    EncogReadHelper in=new EncogReadHelper(is);
    EncogFileSection section;
    while ((section=in.readNextSection()) != null) {
      if (section.getSectionName().equals("String_Node_Str") && section.getSubSectionName().equals("String_Node_Str")) {
        Map<String,EncogFileLine> params=section.parseParams();
        this.defaultError=EncogFileSection.parseDouble(params,EncogWorkBenchConfig.PROPERTY_DEFAULT_ERROR);
        this.threadCount=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT);
        this.useOpenCL=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_THREAD_COUNT) > 0;
        this.errorCalculation=EncogFileSection.parseInt(params,EncogWorkBenchConfig.PROPERTY_ERROR_CALC);
      }
    }
    is.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17665
Project: 17665
Buggy source:
/** 
 * The main entry point into the program. To support opening documents by double clicking their file, the first parameter specifies a file to open.
 * @param args The first argument specifies an option file to open.
 */
public static void main(final String args[]){
  final EncogWorkBench workBench=EncogWorkBench.getInstance();
  workBench.setMainWindow(new EncogDocumentFrame());
  workBench.init();
  try {
    workBench.getMainWindow().setVisible(true);
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t.getMessage());
    t.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * The main entry point into the program. To support opening documents by double clicking their file, the first parameter specifies a file to open.
 * @param args The first argument specifies an option file to open.
 */
public static void main(final String args[]){
  Encog.getInstance();
  final EncogWorkBench workBench=EncogWorkBench.getInstance();
  workBench.setMainWindow(new EncogDocumentFrame());
  workBench.init();
  try {
    workBench.getMainWindow().setVisible(true);
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t.getMessage());
    t.printStackTrace();
  }
}
Program: 17666
Project: 17666
Buggy source:
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()) {
    MLDataSet 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().getTabManager().openModalTab(tab,"String_Node_Str");
    return null;
  }
  return null;
}

Fixed version (ground truth):
private static BasicNetwork createAutomatic(File path){
  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()) {
    MLDataSet 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,path);
    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().getTabManager().openModalTab(tab,"String_Node_Str");
    return null;
  }
  return null;
}
Program: 17667
Project: 17667
Buggy source:
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;
case PNN:
network=createPNN();
break;
}
if (network != null) {
EncogWorkBench.getInstance().save(path,network);
EncogWorkBench.getInstance().refresh();
}
}
}

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(path);
    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;
case PNN:
network=createPNN();
break;
}
if (network != null) {
EncogWorkBench.getInstance().save(path,network);
EncogWorkBench.getInstance().refresh();
}
}
}
Program: 17668
Project: 17668
Buggy source:
public void performClose(){
  if (this.prune != null) {
    BasicNetwork network=this.prune.getBestNetwork();
    if (network != null) {
      if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
        if (network != null) {
          this.getEncogObject().save();
          EncogWorkBench.getInstance().refresh();
        }
      }
    }
  }
}

Fixed version (ground truth):
public void performClose(){
  if (this.prune != null) {
    BasicNetwork network=this.prune.getBestNetwork();
    if (network != null) {
      if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
        if (network != null) {
          EncogDirectoryPersistence.saveObject(this.path,network);
          EncogWorkBench.getInstance().refresh();
        }
      }
    }
  }
}
Program: 17669
Project: 17669
Buggy source:
public IncrementalPruneTab(int iterations,int weightTries,int windowSize,MLDataSet training,FeedForwardPattern pattern){
  super(null);
  this.weightTries=weightTries;
  this.iterations=iterations;
  this.training=training;
  this.pattern=pattern;
  this.windowSize=windowSize;
  this.prune=new PruneIncremental(this.training,this.pattern,this.iterations,this.weightTries,this.windowSize,this);
  this.prune.init();
  this.buttonStart=new JButton("String_Node_Str");
  this.buttonStop=new JButton("String_Node_Str");
  this.buttonClose=new JButton("String_Node_Str");
  this.buttonStart.addActionListener(this);
  this.buttonStop.addActionListener(this);
  this.buttonClose.addActionListener(this);
  setLayout(new BorderLayout());
  this.panelBody=new JPanel();
  this.panelButtons=new JPanel();
  this.panelButtons.add(this.buttonStart);
  this.panelButtons.add(this.buttonStop);
  this.panelButtons.add(this.buttonClose);
  add(this.panelBody,BorderLayout.CENTER);
  add(this.panelButtons,BorderLayout.SOUTH);
  this.panelBody.setLayout(new BorderLayout());
  this.panelBody.add(this.statusPanel=new IncrementalPruneStatusPanel(this),BorderLayout.NORTH);
  this.panelBody.add(this.chartPanel=new IncrementalPruneChart(this),BorderLayout.CENTER);
  this.buttonStop.setEnabled(false);
  this.shouldExit=false;
  this.bodyFont=EncogFonts.getInstance().getBodyFont();
  this.headFont=EncogFonts.getInstance().getHeadFont();
  this.status="String_Node_Str";
}

Fixed version (ground truth):
public IncrementalPruneTab(int iterations,int weightTries,int windowSize,MLDataSet training,FeedForwardPattern pattern,File path){
  super(null);
  this.weightTries=weightTries;
  this.iterations=iterations;
  this.training=training;
  this.pattern=pattern;
  this.windowSize=windowSize;
  this.prune=new PruneIncremental(this.training,this.pattern,this.iterations,this.weightTries,this.windowSize,this);
  this.prune.init();
  this.buttonStart=new JButton("String_Node_Str");
  this.buttonStop=new JButton("String_Node_Str");
  this.buttonClose=new JButton("String_Node_Str");
  this.buttonStart.addActionListener(this);
  this.buttonStop.addActionListener(this);
  this.buttonClose.addActionListener(this);
  this.path=path;
  setLayout(new BorderLayout());
  this.panelBody=new JPanel();
  this.panelButtons=new JPanel();
  this.panelButtons.add(this.buttonStart);
  this.panelButtons.add(this.buttonStop);
  this.panelButtons.add(this.buttonClose);
  add(this.panelBody,BorderLayout.CENTER);
  add(this.panelButtons,BorderLayout.SOUTH);
  this.panelBody.setLayout(new BorderLayout());
  this.panelBody.add(this.statusPanel=new IncrementalPruneStatusPanel(this),BorderLayout.NORTH);
  this.panelBody.add(this.chartPanel=new IncrementalPruneChart(this),BorderLayout.CENTER);
  this.buttonStop.setEnabled(false);
  this.shouldExit=false;
  this.bodyFont=EncogFonts.getInstance().getBodyFont();
  this.headFont=EncogFonts.getInstance().getHeadFont();
  this.status="String_Node_Str";
}
Program: 17670
Project: 17670
Buggy source:
private void performClose(){
  if (error)   return;
  if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
    if (this.getEncogObject() != null) {
      ((ProjectEGFile)this.getEncogObject()).save(train.getMethod());
      if (this.getParentTab() != null) {
        this.getParentTab().setEncogObject(this.getEncogObject());
      }
    }
    if (this.train.canContinue()) {
      TrainingContinuation cont=train.pause();
      String name=FileUtil.getFileName(this.getEncogObject().getFile());
      name=FileUtil.forceExtension(name + "String_Node_Str","String_Node_Str");
      File path=new File(name);
      EncogWorkBench.getInstance().save(path,cont);
      EncogWorkBench.getInstance().refresh();
    }
    EncogWorkBench.getInstance().refresh();
  }
 else {
    if (this.getEncogObject() != null) {
      ((ProjectEGFile)this.getEncogObject()).revert();
    }
  }
}

Fixed version (ground truth):
private void performClose(){
  if (error)   return;
  if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
    if (this.getEncogObject() != null) {
      Object obj=((ProjectEGFile)this.getEncogObject()).getObject();
      if (obj instanceof NEATPopulation) {
        saveNEATPopulation();
      }
 else {
        saveMLMethod();
      }
    }
    EncogWorkBench.getInstance().refresh();
  }
 else {
    if (this.getEncogObject() != null) {
      ((ProjectEGFile)this.getEncogObject()).revert();
    }
  }
}
Program: 17671
Project: 17671
Buggy source:
private void readRawFile(){
  ScriptProperties prop=this.analyst.getScript().getProperties();
  String sourceID=prop.getPropertyString(ScriptProperties.HEADER_DATASOURCE_RAW_FILE);
  File sourceFile=this.analyst.getScript().resolveFilename(sourceID);
  CSVFormat inputFormat=this.analyst.getScript().determineInputFormat(sourceID);
  boolean headers=this.analyst.getScript().expectInputHeaders(sourceID);
  int rowSize=this.axisMapping.size();
  boolean regression=!this.targetField.isClass();
  ReadCSV csv=new ReadCSV(sourceFile.toString(),headers,inputFormat);
  while (csv.next()) {
    double[] row=new double[rowSize];
    List<double[]> dataList;
    String cls="String_Node_Str";
    if (regression) {
      double d=csv.getDouble(targetIndex);
      for (int i=this.series.size() - 1; i >= 0; i--) {
        if (d > this.regressionSeriesPoint[i]) {
          cls=this.series.get(i);
          break;
        }
      }
    }
 else {
      cls=csv.get(this.targetIndex);
      cls=cls.toLowerCase();
    }
    if (this.data.containsKey(cls)) {
      dataList=this.data.get(cls);
    }
 else {
      dataList=new ArrayList<double[]>();
      this.data.put(cls,dataList);
    }
    int rowIndex=0;
    for (    String key : this.axis) {
      int index=this.axisMapping.get(key);
      double d=csv.getDouble(index);
      row[rowIndex++]=d;
    }
    dataList.add(row);
  }
  csv.close();
}

Fixed version (ground truth):
private void readRawFile(){
  ScriptProperties prop=this.analyst.getScript().getProperties();
  String sourceID=prop.getPropertyString(ScriptProperties.HEADER_DATASOURCE_RAW_FILE);
  File sourceFile=this.analyst.getScript().resolveFilename(sourceID);
  CSVFormat inputFormat=this.analyst.getScript().determineFormat();
  boolean headers=this.analyst.getScript().expectInputHeaders(sourceID);
  int rowSize=this.axisMapping.size();
  boolean regression=!this.targetField.isClass();
  ReadCSV csv=new ReadCSV(sourceFile.toString(),headers,inputFormat);
  while (csv.next()) {
    double[] row=new double[rowSize];
    List<double[]> dataList;
    String cls="String_Node_Str";
    if (regression) {
      double d=csv.getDouble(targetIndex);
      for (int i=this.series.size() - 1; i >= 0; i--) {
        if (d > this.regressionSeriesPoint[i]) {
          cls=this.series.get(i);
          break;
        }
      }
    }
 else {
      cls=csv.get(this.targetIndex);
      cls=cls.toLowerCase();
    }
    if (this.data.containsKey(cls)) {
      dataList=this.data.get(cls);
    }
 else {
      dataList=new ArrayList<double[]>();
      this.data.put(cls,dataList);
    }
    int rowIndex=0;
    for (    String key : this.axis) {
      int index=this.axisMapping.get(key);
      double d=csv.getDouble(index);
      row[rowIndex++]=d;
    }
    dataList.add(row);
  }
  csv.close();
}
Program: 17672
Project: 17672
Buggy source:
public String popup(PopupField field){
  ActivationDialog dialog=new ActivationDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setActivation(this.activationFunctionHidden);
  if (!dialog.process())   return null;
 else   if (field == this.activationFieldHidden) {
    this.activationFunctionHidden=dialog.getActivation();
    return dialog.getActivation().getClass().getSimpleName();
  }
 else   if (field == this.activationFieldOutput) {
    this.activationFunctionOutput=dialog.getActivation();
    return dialog.getActivation().getClass().getSimpleName();
  }
 else   return null;
}

Fixed version (ground truth):
public String popup(PopupField field){
  ActivationDialog dialog=new ActivationDialog(EncogWorkBench.getInstance().getMainWindow());
  if (field == this.activationFieldHidden) {
    dialog.setActivation(this.activationFunctionHidden);
  }
 else   if (field == this.activationFieldOutput) {
    dialog.setActivation(this.activationFunctionOutput);
  }
  if (!dialog.process())   return null;
 else   if (field == this.activationFieldHidden) {
    this.activationFunctionHidden=dialog.getActivation();
    return dialog.getActivation().getClass().getSimpleName();
  }
 else   if (field == this.activationFieldOutput) {
    this.activationFunctionOutput=dialog.getActivation();
    return dialog.getActivation().getClass().getSimpleName();
  }
 else   return null;
}
Program: 17674
Project: 17674
Buggy source:
public NewPopulationDialog(){
  super(EncogWorkBench.getInstance().getMainWindow());
  this.setSize(400,200);
  this.setTitle("String_Node_Str");
  addProperty(this.populationSize=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.inputNeurons=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.outputNeurons=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.snapshot=new CheckField("String_Node_Str","String_Node_Str"));
  addProperty(this.outputActivationField=new PopupField("String_Node_Str","String_Node_Str",true));
  addProperty(this.neatActivationField=new PopupField("String_Node_Str","String_Node_Str",true));
  render();
  this.setNeatActivationFunction(new ActivationSigmoid());
  this.setOutputActivationFunction(new ActivationLinear());
}

Fixed version (ground truth):
public NewPopulationDialog(){
  super(EncogWorkBench.getInstance().getMainWindow());
  this.setSize(400,200);
  this.setTitle("String_Node_Str");
  addProperty(this.populationSize=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.inputNeurons=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.outputNeurons=new IntegerField("String_Node_Str","String_Node_Str",true,1,-1));
  addProperty(this.activationCycles=new IntegerField("String_Node_Str","String_Node_Str",true,0,5000));
  addProperty(this.outputActivationField=new PopupField("String_Node_Str","String_Node_Str",true));
  addProperty(this.neatActivationField=new PopupField("String_Node_Str","String_Node_Str",true));
  render();
  this.setNeatActivationFunction(new ActivationSigmoid());
  this.setOutputActivationFunction(new ActivationLinear());
}
Program: 17675
Project: 17675
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();
    boolean snapshot=dialog.getSnapshot().getValue();
    NEATPopulation pop=new NEATPopulation(inputCount,outputCount,populationSize);
    pop.setSnapshot(snapshot);
    pop.setNeatActivationFunction(dialog.getNeatActivationFunction());
    pop.setOutputActivationFunction(dialog.getOutputActivationFunction());
    EncogWorkBench.getInstance().save(path,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();
    int cycles=dialog.getActivationCycles().getValue();
    NEATPopulation pop=new NEATPopulation(inputCount,outputCount,populationSize);
    pop.setActivationCycles(cycles);
    pop.setNeatActivationFunction(dialog.getNeatActivationFunction());
    pop.setOutputActivationFunction(dialog.getOutputActivationFunction());
    EncogWorkBench.getInstance().save(path,pop);
    EncogWorkBench.getInstance().refresh();
  }
}