nus-yam/ex-repair huggingface dataset:
Program: 17676
Project: 17676
Buggy source:
/** 
 * Construct the dialog box.
 * @param owner The owner of the dialog box.
 */
public RandomizeNetworkDialog(final Frame owner){
  super(owner);
  setTitle("String_Node_Str");
  setSize(400,400);
  setLocation(200,200);
  List<String> types=new ArrayList<String>();
  types.add("String_Node_Str");
  types.add("String_Node_Str");
  types.add("String_Node_Str");
  this.setCollectCurrentTabOnly(true);
  this.beginTab("String_Node_Str");
  addProperty(this.high=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.low=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.type=new ComboBoxField("String_Node_Str","String_Node_Str",true,types));
  this.beginTab("String_Node_Str");
  addProperty(this.perturbPercent=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  this.beginTab("String_Node_Str");
  addProperty(this.mean=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.deviation=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  this.beginTab("String_Node_Str");
  addProperty(this.seedValue=new IntegerField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.constHigh=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.constLow=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  this.beginTab("String_Node_Str");
  addProperty(this.constantValue=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  render();
}

Fixed version (ground truth):
/** 
 * Construct the dialog box.
 * @param owner The owner of the dialog box.
 */
public RandomizeNetworkDialog(final Frame owner){
  super(owner);
  setTitle("String_Node_Str");
  setSize(400,400);
  setLocation(200,200);
  List<String> types=new ArrayList<String>();
  types.add("String_Node_Str");
  types.add("String_Node_Str");
  types.add("String_Node_Str");
  this.setCollectCurrentTabOnly(true);
  this.beginTab("String_Node_Str");
  addProperty(this.high=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.low=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.theType=new ComboBoxField("String_Node_Str","String_Node_Str",true,types));
  this.beginTab("String_Node_Str");
  addProperty(this.perturbPercent=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  this.beginTab("String_Node_Str");
  addProperty(this.mean=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.deviation=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  this.beginTab("String_Node_Str");
  addProperty(this.seedValue=new IntegerField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.constHigh=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  addProperty(this.constLow=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  this.beginTab("String_Node_Str");
  addProperty(this.constantValue=new DoubleField("String_Node_Str","String_Node_Str",true,0,-1));
  render();
}
Program: 17677
Project: 17677
Buggy source:
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.type=CreateFileType.TextFile;
  break;
case 1:
this.type=CreateFileType.MachineLearningMethod;
break;
case 2:
this.type=CreateFileType.CSVFile;
break;
case 3:
this.type=CreateFileType.TrainingFile;
break;
case 4:
this.type=CreateFileType.NEAT;
break;
}
this.filename=this.objectNameField.getText();
}

Fixed version (ground truth):
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.theType=CreateFileType.TextFile;
  break;
case 1:
this.theType=CreateFileType.MachineLearningMethod;
break;
case 2:
this.theType=CreateFileType.CSVFile;
break;
case 3:
this.theType=CreateFileType.TrainingFile;
break;
case 4:
this.theType=CreateFileType.NEAT;
break;
}
this.filename=this.objectNameField.getText();
}
Program: 17678
Project: 17678
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;
case NEAT:
this.list.setSelectedIndex(4);
break;
}
}

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

Fixed version (ground truth):
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.theType=NeuralNetworkType.Automatic;
  break;
case 1:
this.theType=NeuralNetworkType.ADALINE;
break;
case 2:
this.theType=NeuralNetworkType.ART1;
break;
case 3:
this.theType=NeuralNetworkType.BAM;
break;
case 4:
this.theType=NeuralNetworkType.Boltzmann;
break;
case 5:
this.theType=NeuralNetworkType.CPN;
break;
case 6:
this.theType=NeuralNetworkType.Feedforward;
break;
case 7:
this.theType=NeuralNetworkType.RBF;
break;
case 8:
this.theType=NeuralNetworkType.SOM;
break;
case 9:
this.theType=NeuralNetworkType.Hopfield;
break;
case 10:
this.theType=NeuralNetworkType.PNN;
break;
case 11:
this.theType=NeuralNetworkType.Elman;
break;
case 12:
this.theType=NeuralNetworkType.Jordan;
break;
case 13:
this.theType=NeuralNetworkType.SVM;
break;
}
}
Program: 17680
Project: 17680
Buggy source:
@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 PNN:
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 (theType) {
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 PNN:
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;
}
}
Program: 17681
Project: 17681
Buggy source:
private void performAdd(){
  try {
    TreePath path=this.tree.getSelectionPath();
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)path.getLastPathComponent();
    if (!(node.getUserObject() instanceof String)) {
      node=(DefaultMutableTreeNode)node.getParent();
    }
    DefaultMutableTreeNode parent=(DefaultMutableTreeNode)node.getParent();
    Object obj=parent.getUserObject();
    String fieldName=node.getUserObject().toString();
    Field field=obj.getClass().getDeclaredField(fieldName);
    field.setAccessible(true);
    Object fieldObject=field.get(obj);
    if (fieldObject instanceof Collection) {
      ParameterizedType gtype=(ParameterizedType)field.getGenericType();
      Type[] types=gtype.getActualTypeArguments();
      Object item=((Class)types[0]).newInstance();
      ((Collection)fieldObject).add(item);
      generateTree();
    }
  }
 catch (  SecurityException e) {
    throw new WorkBenchError(e);
  }
catch (  NoSuchFieldException e) {
    throw new WorkBenchError(e);
  }
catch (  IllegalAccessException e) {
    throw new WorkBenchError(e);
  }
catch (  InstantiationException e) {
    throw new WorkBenchError(e);
  }
}

Fixed version (ground truth):
private void performAdd(){
  try {
    TreePath path=this.tree.getSelectionPath();
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)path.getLastPathComponent();
    if (!(node.getUserObject() instanceof String)) {
      node=(DefaultMutableTreeNode)node.getParent();
    }
    DefaultMutableTreeNode parent=(DefaultMutableTreeNode)node.getParent();
    Object obj=parent.getUserObject();
    String fieldName=node.getUserObject().toString();
    Field field=obj.getClass().getDeclaredField(fieldName);
    field.setAccessible(true);
    Object fieldObject=field.get(obj);
    if (fieldObject instanceof Collection) {
      ParameterizedType gtype=(ParameterizedType)field.getGenericType();
      java.lang.reflect.Type[] types=gtype.getActualTypeArguments();
      Object item=((Class)types[0]).newInstance();
      ((Collection)fieldObject).add(item);
      generateTree();
    }
  }
 catch (  SecurityException e) {
    throw new WorkBenchError(e);
  }
catch (  NoSuchFieldException e) {
    throw new WorkBenchError(e);
  }
catch (  IllegalAccessException e) {
    throw new WorkBenchError(e);
  }
catch (  InstantiationException e) {
    throw new WorkBenchError(e);
  }
}
Program: 17682
Project: 17682
Buggy source:
public void performCreateTrainingData() throws IOException {
  CreateTrainingDataDialog dialog=new CreateTrainingDataDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setType(TrainingDataType.CopyCSV);
  if (dialog.process()) {
    String name=dialog.getFilenameName();
    if (name.trim().length() == 0) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    name=FileUtil.forceExtension(name,"String_Node_Str");
    File targetFile=new File(EncogWorkBench.getInstance().getProjectDirectory(),name);
    if (!EncogWorkBench.getInstance().getMainWindow().getTabManager().queryViews(targetFile)) {
      return;
    }
switch (dialog.getType()) {
case CopyCSV:
      CreateTrainingData.copyCSV(name);
    break;
case MarketWindow:
  CreateTrainingData.downloadMarketData(name);
break;
case Random:
CreateTrainingData.generateRandom(name);
break;
case XORTemp:
CreateTrainingData.generateXORTemp(name);
break;
case XOR:
CreateTrainingData.copyXOR(name);
break;
case Iris:
CreateTrainingData.copyIris(name);
break;
case Sunspots:
CreateTrainingData.downloadSunspots(name);
break;
case Digits:
CreateTrainingData.copyDigits(name);
break;
case Patterns1:
CreateTrainingData.copyPatterns1(name);
break;
case Patterns2:
CreateTrainingData.copyPatterns2(name);
break;
case Download:
CreateTrainingData.downloadURL(name);
break;
}
EncogWorkBench.getInstance().refresh();
}
}

Fixed version (ground truth):
public void performCreateTrainingData() throws IOException {
  CreateTrainingDataDialog dialog=new CreateTrainingDataDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setTheType(TrainingDataType.CopyCSV);
  if (dialog.process()) {
    String name=dialog.getFilenameName();
    if (name.trim().length() == 0) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    name=FileUtil.forceExtension(name,"String_Node_Str");
    File targetFile=new File(EncogWorkBench.getInstance().getProjectDirectory(),name);
    if (!EncogWorkBench.getInstance().getMainWindow().getTabManager().queryViews(targetFile)) {
      return;
    }
switch (dialog.getTheType()) {
case CopyCSV:
      CreateTrainingData.copyCSV(name);
    break;
case MarketWindow:
  CreateTrainingData.downloadMarketData(name);
break;
case Random:
CreateTrainingData.generateRandom(name);
break;
case XORTemp:
CreateTrainingData.generateXORTemp(name);
break;
case XOR:
CreateTrainingData.copyXOR(name);
break;
case Iris:
CreateTrainingData.copyIris(name);
break;
case Sunspots:
CreateTrainingData.downloadSunspots(name);
break;
case Digits:
CreateTrainingData.copyDigits(name);
break;
case Patterns1:
CreateTrainingData.copyPatterns1(name);
break;
case Patterns2:
CreateTrainingData.copyPatterns2(name);
break;
case Download:
CreateTrainingData.downloadURL(name);
break;
}
EncogWorkBench.getInstance().refresh();
}
}
Program: 17683
Project: 17683
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(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();
}
}
}

Fixed version (ground truth):
public static void process(File path){
  MLMethod network=null;
  CreateNeuralNetworkDialog dialog=new CreateNeuralNetworkDialog(EncogWorkBench.getInstance().getMainWindow());
  dialog.setTheType(NeuralNetworkType.Feedforward);
  if (dialog.process()) {
switch (dialog.getTheType()) {
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: 17686
Project: 17686
Buggy source:
private void optionRandomize(RandomizeNetworkDialog dialog){
  Randomizer r=null;
switch (dialog.getType().getSelectedIndex()) {
case 0:
    r=new RangeRandomizer(dialog.getLow().getValue(),dialog.getHigh().getValue());
  break;
case 1:
r=new NguyenWidrowRandomizer(dialog.getLow().getValue(),dialog.getHigh().getValue());
break;
case 2:
r=new FanInRandomizer(dialog.getLow().getValue(),dialog.getHigh().getValue(),false);
break;
}
if (r != null) {
r.randomize((BasicNetwork)this.method);
setDirty(true);
}
}

Fixed version (ground truth):
private void optionRandomize(RandomizeNetworkDialog dialog){
  Randomizer r=null;
switch (dialog.getTheType().getSelectedIndex()) {
case 0:
    r=new RangeRandomizer(dialog.getLow().getValue(),dialog.getHigh().getValue());
  break;
case 1:
r=new NguyenWidrowRandomizer(dialog.getLow().getValue(),dialog.getHigh().getValue());
break;
case 2:
r=new FanInRandomizer(dialog.getLow().getValue(),dialog.getHigh().getValue(),false);
break;
}
if (r != null) {
r.randomize((BasicNetwork)this.method);
setDirty(true);
}
}
Program: 17689
Project: 17689
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).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().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();
}
Program: 17690
Project: 17690
Buggy source:
private void buildMappings(String target,List<String> axis){
  DataField[] fields=this.analyst.getScript().getFields();
  this.targetField=this.analyst.getScript().findDataField(target);
  if (targetField == null) {
    throw new WorkBenchError("String_Node_Str" + target);
  }
  this.targetIndex=this.analyst.getScript().findDataFieldIndex(targetField);
  if (targetField.isClass()) {
    for (    AnalystClassItem cls : targetField.getClassMembers()) {
      this.series.add(cls.getName());
    }
  }
 else {
    this.regressionSeriesPoint=new double[10];
    double totalWidth=targetField.getMax() - targetField.getMin();
    this.regressionSeriesSize=totalWidth / 12;
    double current=targetField.getMin() + this.regressionSeriesSize;
    for (int i=0; i < 10; i++) {
      StringBuilder s=new StringBuilder();
      s.append(Format.formatDouble(current,1));
      this.data.put(s.toString(),new ArrayList<double[]>());
      this.series.add(s.toString());
      this.regressionSeriesPoint[i]=current;
      current+=this.regressionSeriesSize;
    }
  }
  for (int index=0; index < fields.length; index++) {
    DataField field=fields[index];
    if (isAxis(field.getName(),axis)) {
      this.axisMapping.put(field.getName().toLowerCase(),index);
    }
  }
}

Fixed version (ground truth):
private void buildMappings(String target,List<String> axis){
  DataField[] fields=this.analyst.getScript().getFields();
  this.targetField=this.analyst.getScript().findDataField(target);
  if (targetField == null) {
    throw new WorkBenchError("String_Node_Str" + target);
  }
  this.targetIndex=this.analyst.getScript().findDataFieldIndex(targetField);
  if (targetField.isClass()) {
    for (    AnalystClassItem cls : targetField.getClassMembers()) {
      this.series.add(cls.getName().toLowerCase());
    }
  }
 else {
    this.regressionSeriesPoint=new double[10];
    double totalWidth=targetField.getMax() - targetField.getMin();
    this.regressionSeriesSize=totalWidth / 12;
    double current=targetField.getMin() + this.regressionSeriesSize;
    for (int i=0; i < 10; i++) {
      StringBuilder s=new StringBuilder();
      s.append(Format.formatDouble(current,1));
      this.data.put(s.toString().toLowerCase(),new ArrayList<double[]>());
      this.series.add(s.toString());
      this.regressionSeriesPoint[i]=current;
      current+=this.regressionSeriesSize;
    }
  }
  for (int index=0; index < fields.length; index++) {
    DataField field=fields[index];
    if (isAxis(field.getName(),axis)) {
      this.axisMapping.put(field.getName().toLowerCase(),index);
    }
  }
}
Program: 17691
Project: 17691
Buggy source:
/** 
 * Returns the number of items in the specified series.
 * @param series  the index (zero-based) of the series.
 * @return the number of items in the specified series.
 */
public int getItemCount(int series){
  return this.scatterFile.getSeries(series).size();
}

Fixed version (ground truth):
/** 
 * Returns the number of items in the specified series.
 * @param series  the index (zero-based) of the series.
 * @return the number of items in the specified series.
 */
public int getItemCount(int series){
  int i=this.scatterFile.getSeries(series).size();
  return i;
}
Program: 17692
Project: 17692
Buggy source:
public CreateNeuralNetworkDialog(Frame owner){
  super(owner);
  setTitle("String_Node_Str");
  this.setSize(500,250);
  this.setLocation(50,100);
  final Container content=getBodyPanel();
  content.setLayout(new GridLayout(1,2));
  content.add(this.scroll1);
  content.add(this.scroll2);
  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.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.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);
}

Fixed version (ground truth):
public CreateNeuralNetworkDialog(Frame owner){
  super(owner);
  setTitle("String_Node_Str");
  this.setSize(500,250);
  this.setLocation(50,100);
  final Container content=getBodyPanel();
  content.setLayout(new GridLayout(1,2));
  content.add(this.scroll1);
  content.add(this.scroll2);
  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.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.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: 17693
Project: 17693
Buggy source:
public void save(MLMethod method){
  this.obj=method;
}

Fixed version (ground truth):
public void save(MLMethod method){
  this.obj=method;
  this.save();
}
Program: 17694
Project: 17694
Buggy source:
public DialogCSV(Frame owner){
  super(owner);
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  this.setSize(640,200);
  this.setTitle("String_Node_Str");
  addProperty(this.headers=new CheckField("String_Node_Str","String_Node_Str"));
  addProperty(this.decimalComma=new CheckField("String_Node_Str","String_Node_Str"));
  render();
}

Fixed version (ground truth):
public DialogCSV(Frame owner){
  super(owner);
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  this.setSize(640,200);
  this.setTitle("String_Node_Str");
  addProperty(this.headers=new CheckField("String_Node_Str","String_Node_Str"));
  addProperty(this.decimalComma=new CheckField("String_Node_Str","String_Node_Str"));
  addProperty(this.generateSignificance=new CheckField("String_Node_Str","String_Node_Str"));
  render();
}
Program: 17695
Project: 17695
Buggy source:
public DialogExternal2Binary(Frame owner){
  super(owner);
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  this.setSize(640,200);
  this.setTitle("String_Node_Str");
  addProperty(this.externalFile=new FileField("String_Node_Str","String_Node_Str",true,false,EncogDocumentFrame.CSV_FILTER));
  addProperty(this.binaryFile=new FileField("String_Node_Str","String_Node_Str",true,true,EncogDocumentFrame.ENCOG_BINARY));
  addProperty(this.fileType=new ComboBoxField("String_Node_Str","String_Node_Str",true,list));
  addProperty(this.inputCount=new IntegerField("String_Node_Str","String_Node_Str",true,1,10000));
  addProperty(this.idealCount=new IntegerField("String_Node_Str","String_Node_Str",true,0,10000));
  render();
}

Fixed version (ground truth):
public DialogExternal2Binary(Frame owner){
  super(owner);
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  this.setSize(640,200);
  this.setTitle("String_Node_Str");
  addProperty(this.externalFile=new FileField("String_Node_Str","String_Node_Str",true,false,EncogDocumentFrame.CSV_FILTER));
  addProperty(this.binaryFile=new FileField("String_Node_Str","String_Node_Str",true,true,EncogDocumentFrame.ENCOG_BINARY));
  addProperty(this.fileType=new ComboBoxField("String_Node_Str","String_Node_Str",true,list));
  addProperty(this.inputCount=new IntegerField("String_Node_Str","String_Node_Str",true,1,10000));
  addProperty(this.idealCount=new IntegerField("String_Node_Str","String_Node_Str",true,0,10000));
  addProperty(this.containsSignificance=new CheckField("String_Node_Str","String_Node_Str"));
  render();
}
Program: 17696
Project: 17696
Buggy source:
public static void performBin2External(File inBinaryFile,TaskComplete done){
  DialogBinary2External dialog=new DialogBinary2External(EncogWorkBench.getInstance().getMainWindow());
  if (inBinaryFile != null)   dialog.getBinaryFile().setValue(inBinaryFile.toString());
  if (dialog.process()) {
    File binaryFile=new File(dialog.getBinaryFile().getValue());
    File externFile=new File(dialog.getExternalFile().getValue());
    int fileType=dialog.getFileType().getSelectedIndex();
    DataSetCODEC codec;
    BinaryDataLoader loader;
    if (fileType == 0) {
      DialogCSV dialog2=new DialogCSV(EncogWorkBench.getInstance().getMainWindow());
      if (dialog2.process()) {
        boolean headers=dialog2.getHeaders().getValue();
        CSVFormat format;
        if (dialog2.getDecimalComma().getValue())         format=CSVFormat.DECIMAL_COMMA;
 else         format=CSVFormat.DECIMAL_POINT;
        codec=new CSVDataCODEC(externFile,format);
        loader=new BinaryDataLoader(codec);
        ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,false);
        dlg.process(done);
      }
    }
 else     if (fileType == 1) {
      codec=new ExcelCODEC(externFile);
      loader=new BinaryDataLoader(codec);
      ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,false);
      dlg.process(done);
    }
  }
}

Fixed version (ground truth):
public static void performBin2External(File inBinaryFile,TaskComplete done){
  DialogBinary2External dialog=new DialogBinary2External(EncogWorkBench.getInstance().getMainWindow());
  if (inBinaryFile != null)   dialog.getBinaryFile().setValue(inBinaryFile.toString());
  if (dialog.process()) {
    File binaryFile=new File(dialog.getBinaryFile().getValue());
    File externFile=new File(dialog.getExternalFile().getValue());
    int fileType=dialog.getFileType().getSelectedIndex();
    DataSetCODEC codec;
    BinaryDataLoader loader;
    if (fileType == 0) {
      DialogCSV dialog2=new DialogCSV(EncogWorkBench.getInstance().getMainWindow());
      if (dialog2.process()) {
        boolean headers=dialog2.getHeaders().getValue();
        CSVFormat format;
        if (dialog2.getDecimalComma().getValue())         format=CSVFormat.DECIMAL_COMMA;
 else         format=CSVFormat.DECIMAL_POINT;
        codec=new CSVDataCODEC(externFile,format,dialog2.getGenerateSignificance().getValue());
        loader=new BinaryDataLoader(codec);
        ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,false);
        dlg.process(done);
      }
    }
 else     if (fileType == 1) {
      codec=new ExcelCODEC(externFile);
      loader=new BinaryDataLoader(codec);
      ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,false);
      dlg.process(done);
    }
  }
}
Program: 17698
Project: 17698
Buggy source:
private void performManhattan(ProjectEGFile file,MLDataSet trainingData){
  InputManhattan dialog=new InputManhattan();
  if (dialog.process()) {
    double learningRate=dialog.getFixedDelta().getValue();
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    Train train=new ManhattanPropagation((BasicNetwork)file.getObject(),trainingData,learningRate);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performManhattan(ProjectEGFile file,MLDataSet trainingData){
  InputManhattan dialog=new InputManhattan();
  if (dialog.process()) {
    double learningRate=dialog.getFixedDelta().getValue();
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    MLTrain train=new ManhattanPropagation((BasicNetwork)file.getObject(),trainingData,learningRate);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17699
Project: 17699
Buggy source:
private void performRPROP(ProjectEGFile file,MLDataSet trainingData){
  InputResilient dialog=new InputResilient();
  if (dialog.process()) {
    final double initialUpdate=dialog.getInitialUpdate().getValue();
    final double maxStep=dialog.getMaxStep().getValue();
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    Train train=new ResilientPropagation((ContainsFlat)file.getObject(),trainingData,initialUpdate,maxStep);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performRPROP(ProjectEGFile file,MLDataSet trainingData){
  InputResilient dialog=new InputResilient();
  if (dialog.process()) {
    final double initialUpdate=dialog.getInitialUpdate().getValue();
    final double maxStep=dialog.getMaxStep().getValue();
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    MLTrain train=new ResilientPropagation((ContainsFlat)file.getObject(),trainingData,initialUpdate,maxStep);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17700
Project: 17700
Buggy source:
private void performADALINE(ProjectEGFile file,MLDataSet trainingData){
  InputADALINE dialog=new InputADALINE();
  if (dialog.process()) {
    double learningRate=dialog.getLearningRate().getValue();
    Train train=new TrainAdaline((BasicNetwork)file.getObject(),trainingData,learningRate);
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performADALINE(ProjectEGFile file,MLDataSet trainingData){
  InputADALINE dialog=new InputADALINE();
  if (dialog.process()) {
    double learningRate=dialog.getLearningRate().getValue();
    MLTrain train=new TrainAdaline((BasicNetwork)file.getObject(),trainingData,learningRate);
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17701
Project: 17701
Buggy source:
private void performGenetic(ProjectEGFile file,MLDataSet trainingData){
  InputGenetic dialog=new InputGenetic();
  if (dialog.process()) {
    final int populationSize=dialog.getPopulationSize().getValue();
    final double mutationPercent=dialog.getMutationPercent().getValue();
    final double percentToMate=dialog.getPercentToMate().getValue();
    CalculateScore score=new TrainingSetScore(trainingData);
    final Train train=new NeuralGeneticAlgorithm((BasicNetwork)file.getObject(),new RangeRandomizer(-1,1),score,populationSize,mutationPercent,percentToMate);
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performGenetic(ProjectEGFile file,MLDataSet trainingData){
  InputGenetic dialog=new InputGenetic();
  if (dialog.process()) {
    final int populationSize=dialog.getPopulationSize().getValue();
    final double mutationPercent=dialog.getMutationPercent().getValue();
    final double percentToMate=dialog.getPercentToMate().getValue();
    CalculateScore score=new TrainingSetScore(trainingData);
    final MLTrain train=new NeuralGeneticAlgorithm((BasicNetwork)file.getObject(),new RangeRandomizer(-1,1),score,populationSize,mutationPercent,percentToMate);
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17702
Project: 17702
Buggy source:
private void performSCG(ProjectEGFile file,MLDataSet trainingData){
  InputSCG dialog=new InputSCG();
  if (dialog.process()) {
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    Train train=new ScaledConjugateGradient((BasicNetwork)file.getObject(),trainingData);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performSCG(ProjectEGFile file,MLDataSet trainingData){
  InputSCG dialog=new InputSCG();
  if (dialog.process()) {
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    MLTrain train=new ScaledConjugateGradient((BasicNetwork)file.getObject(),trainingData);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17703
Project: 17703
Buggy source:
private void startup(ProjectEGFile file,Train train,double maxError){
  BasicTrainingProgress tab=new BasicTrainingProgress(train,file,train.getTraining());
  if (this.parentTab != null) {
    tab.setParentTab(tab);
  }
  tab.setMaxError(maxError);
  EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
}

Fixed version (ground truth):
private void startup(ProjectEGFile file,MLTrain train,double maxError){
  BasicTrainingProgress tab=new BasicTrainingProgress(train,file,train.getTraining());
  if (this.parentTab != null) {
    tab.setParentTab(tab);
  }
  tab.setMaxError(maxError);
  EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
}
Program: 17704
Project: 17704
Buggy source:
private void performBPROP(ProjectEGFile file,MLDataSet trainingData){
  InputBackpropagation dialog=new InputBackpropagation();
  if (dialog.process()) {
    double learningRate=dialog.getLearningRate().getValue();
    double momentum=dialog.getMomentum().getValue();
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    Train train=new Backpropagation((BasicNetwork)file.getObject(),trainingData,learningRate,momentum);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performBPROP(ProjectEGFile file,MLDataSet trainingData){
  InputBackpropagation dialog=new InputBackpropagation();
  if (dialog.process()) {
    double learningRate=dialog.getLearningRate().getValue();
    double momentum=dialog.getMomentum().getValue();
    int kFold=dialog.getKfold().getValue();
    if (kFold > 0) {
      trainingData=this.wrapTrainingData(trainingData);
    }
    MLTrain train=new Backpropagation((BasicNetwork)file.getObject(),trainingData,learningRate,momentum);
    if (kFold > 0) {
      train=this.wrapTrainer(trainingData,train,kFold);
    }
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17705
Project: 17705
Buggy source:
private Train wrapTrainer(MLDataSet folded,Train train,int foldCount){
  final CrossValidationKFold trainFolded=new CrossValidationKFold(train,foldCount);
  return trainFolded;
}

Fixed version (ground truth):
private MLTrain wrapTrainer(MLDataSet folded,MLTrain train,int foldCount){
  final CrossValidationKFold trainFolded=new CrossValidationKFold(train,foldCount);
  return trainFolded;
}
Program: 17706
Project: 17706
Buggy source:
private void performAnnealing(ProjectEGFile file,MLDataSet trainingData){
  InputAnneal dialog=new InputAnneal();
  if (dialog.process()) {
    final double startTemp=dialog.getStartTemp().getValue();
    final double stopTemp=dialog.getStartTemp().getValue();
    final int cycles=dialog.getCycles().getValue();
    CalculateScore score=new TrainingSetScore(trainingData);
    final Train train=new NeuralSimulatedAnnealing((BasicNetwork)file.getObject(),score,startTemp,stopTemp,cycles);
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}

Fixed version (ground truth):
private void performAnnealing(ProjectEGFile file,MLDataSet trainingData){
  InputAnneal dialog=new InputAnneal();
  if (dialog.process()) {
    final double startTemp=dialog.getStartTemp().getValue();
    final double stopTemp=dialog.getStartTemp().getValue();
    final int cycles=dialog.getCycles().getValue();
    CalculateScore score=new TrainingSetScore(trainingData);
    final MLTrain train=new NeuralSimulatedAnnealing((BasicNetwork)file.getObject(),score,startTemp,stopTemp,cycles);
    startup(file,train,dialog.getMaxError().getValue() / 100.0);
  }
}
Program: 17708
Project: 17708
Buggy source:
/** 
 * @param train the train to set
 */
public void setTrain(final Train train){
  this.train=train;
}

Fixed version (ground truth):
/** 
 * @param train the train to set
 */
public void setTrain(final MLTrain train){
  this.train=train;
}
Program: 17709
Project: 17709
Buggy source:
/** 
 * @return the train
 */
public Train getTrain(){
  return this.train;
}

Fixed version (ground truth):
/** 
 * @return the train
 */
public MLTrain getTrain(){
  return this.train;
}
Program: 17710
Project: 17710
Buggy source:
public void save(){
  if (this.getObject() != null) {
    EncogWorkBench.getInstance().getProject().saveToDirectory(this.getName(),this.getObject());
  }
}

Fixed version (ground truth):
public void save(MLMethod method){
  this.obj=method;
}
Program: 17711
Project: 17711
Buggy source:
private void performClose(){
  if (error)   return;
  if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
    if (this.getEncogObject() != null) {
      this.getEncogObject().save();
      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) {
      ((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();
    }
  }
}
Program: 17714
Project: 17714
Buggy source:
/** 
 * Construct the dialog box.
 * @param owner
 */
public InputInstar(){
  super(EncogWorkBench.getInstance().getMainWindow());
  setTitle("String_Node_Str");
  addProperty(this.learningRate=new DoubleField("String_Node_Str","String_Node_Str",true,-1,-1));
  render();
  this.learningRate.setValue(0.7);
  this.getMaxError().setValue(EncogWorkBench.getInstance().getConfig().getDefaultError());
}

Fixed version (ground truth):
/** 
 * Construct the dialog box.
 * @param owner
 */
public InputInstar(){
  super(EncogWorkBench.getInstance().getMainWindow());
  setTitle("String_Node_Str");
  addProperty(this.learningRate=new DoubleField("String_Node_Str","String_Node_Str",true,-1,-1));
  addProperty(this.initWeights=new CheckField("String_Node_Str","String_Node_Str"));
  render();
  this.learningRate.setValue(0.7);
  this.getMaxError().setValue(EncogWorkBench.getInstance().getConfig().getDefaultError());
  this.getInitWeights().setValue(true);
}
Program: 17715
Project: 17715
Buggy source:
/** 
 * Construct the dialog box.
 * @param owner
 */
public InputOutstar(final Frame owner){
  super(EncogWorkBench.getInstance().getMainWindow());
  setTitle("String_Node_Str");
  addProperty(this.learningRate=new DoubleField("String_Node_Str","String_Node_Str",true,-1,-1));
  render();
  this.learningRate.setValue(0.7);
  this.getMaxError().setValue(0.01);
}

Fixed version (ground truth):
/** 
 * Construct the dialog box.
 * @param owner
 */
public InputOutstar(){
  super(EncogWorkBench.getInstance().getMainWindow());
  setTitle("String_Node_Str");
  addProperty(this.learningRate=new DoubleField("String_Node_Str","String_Node_Str",true,-1,-1));
  render();
  this.learningRate.setValue(0.7);
  this.getMaxError().setValue(0.01);
}
Program: 17716
Project: 17716
Buggy source:
private void performCPN(ProjectEGFile file,NeuralDataSet trainingData){
  SelectItem selectInstar;
  SelectItem selectOutstar;
  List<SelectItem> list=new ArrayList<SelectItem>();
  list.add(selectInstar=new SelectItem("String_Node_Str","String_Node_Str"));
  list.add(selectOutstar=new SelectItem("String_Node_Str","String_Node_Str"));
  SelectDialog sel=new SelectDialog(EncogWorkBench.getInstance().getMainWindow(),list);
  sel.setVisible(true);
  if (sel.getSelected() == selectInstar) {
    InputInstar dialog=new InputInstar();
    if (dialog.process()) {
    }
  }
 else   if (sel.getSelected() == selectOutstar) {
  }
}

Fixed version (ground truth):
private void performCPN(ProjectEGFile file,NeuralDataSet trainingData){
  SelectItem selectInstar;
  SelectItem selectOutstar;
  List<SelectItem> list=new ArrayList<SelectItem>();
  list.add(selectInstar=new SelectItem("String_Node_Str","String_Node_Str"));
  list.add(selectOutstar=new SelectItem("String_Node_Str","String_Node_Str"));
  SelectDialog sel=new SelectDialog(EncogWorkBench.getInstance().getMainWindow(),list);
  sel.setVisible(true);
  if (sel.getSelected() == selectInstar) {
    InputInstar dialog=new InputInstar();
    if (dialog.process()) {
      double learnRate=dialog.getLearningRate().getValue();
      boolean init=dialog.getInitWeights().getValue();
      TrainInstar train=new TrainInstar((CPN)file.getObject(),trainingData,learnRate,init);
      startup(file,train,dialog.getMaxError().getValue() / 100.0);
    }
  }
 else   if (sel.getSelected() == selectOutstar) {
    InputOutstar dialog=new InputOutstar();
    if (dialog.process()) {
      double learnRate=dialog.getLearningRate().getValue();
      TrainOutstar train=new TrainOutstar((CPN)file.getObject(),trainingData,learnRate);
      startup(file,train,dialog.getMaxError().getValue() / 100.0);
    }
  }
}
Program: 17719
Project: 17719
Buggy source:
public void save(String name,MLMethod network){
  File file=new File(getProjectDirectory(),name);
  EncogDirectoryPersistence.saveObject(file,network);
  refresh();
}

Fixed version (ground truth):
public void save(String name,Object network){
  File file=new File(getProjectDirectory(),name);
  EncogDirectoryPersistence.saveObject(file,network);
  refresh();
}
Program: 17720
Project: 17720
Buggy source:
public void valueChanged(ListSelectionEvent e){
switch (list.getSelectedIndex()) {
case 0:
    this.text.setText("String_Node_Str");
  break;
case 1:
this.text.setText("String_Node_Str");
break;
case 2:
this.text.setText("String_Node_Str");
break;
case 3:
this.text.setText("String_Node_Str");
break;
}
this.text.setSelectionStart(0);
this.text.setSelectionEnd(0);
}

Fixed version (ground truth):
public void valueChanged(ListSelectionEvent e){
switch (list.getSelectedIndex()) {
case 0:
    this.text.setText("String_Node_Str");
  break;
case 1:
this.text.setText("String_Node_Str");
break;
case 2:
this.text.setText("String_Node_Str");
break;
case 3:
this.text.setText("String_Node_Str");
break;
case 4:
this.text.setText("String_Node_Str");
break;
}
this.text.setSelectionStart(0);
this.text.setSelectionEnd(0);
}
Program: 17721
Project: 17721
Buggy source:
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.type=CreateFileType.TextFile;
  break;
case 1:
this.type=CreateFileType.MachineLearningMethod;
break;
case 2:
this.type=CreateFileType.CSVFile;
break;
case 3:
this.type=CreateFileType.TrainingFile;
break;
}
this.filename=this.objectNameField.getText();
}

Fixed version (ground truth):
@Override public void collectFields() throws ValidationException {
switch (list.getSelectedIndex()) {
case 0:
    this.type=CreateFileType.TextFile;
  break;
case 1:
this.type=CreateFileType.MachineLearningMethod;
break;
case 2:
this.type=CreateFileType.CSVFile;
break;
case 3:
this.type=CreateFileType.TrainingFile;
break;
case 4:
this.type=CreateFileType.NEAT;
break;
}
this.filename=this.objectNameField.getText();
}