nus-yam/ex-repair huggingface dataset:
Program: 17596
Project: 17596
Buggy source:
public WizardMethodType getMethodType(){
switch (this.method.getSelectedIndex()) {
case 0:
    return WizardMethodType.BayesianNetwork;
case 1:
  return WizardMethodType.FeedForward;
case 2:
return WizardMethodType.NEAT;
case 3:
return WizardMethodType.RBF;
case 4:
return WizardMethodType.PNN;
case 5:
return WizardMethodType.SOM;
case 6:
return WizardMethodType.SVM;
default :
return null;
}
}

Fixed version (ground truth):
public WizardMethodType getMethodType(){
switch (this.method.getSelectedIndex()) {
case 0:
    return WizardMethodType.BayesianNetwork;
case 1:
  return WizardMethodType.EPL;
case 2:
return WizardMethodType.FeedForward;
case 3:
return WizardMethodType.NEAT;
case 4:
return WizardMethodType.RBF;
case 5:
return WizardMethodType.PNN;
case 6:
return WizardMethodType.SOM;
case 7:
return WizardMethodType.SVM;
default :
return null;
}
}
Program: 17597
Project: 17597
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.getNeuronsChromosome().size());
case 2:
return Format.formatInteger(genome.getLinksChromosome().size());
case 3:
return Format.formatDouble(genome.getScore(),4);
case 4:
return Format.formatInteger(this.maxGeneration - genome.getBirthGeneration());
case 5:
return Format.formatInteger(genome.getBirthGeneration());
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(genome.getNeuronsChromosome().size());
case 1:
  return Format.formatInteger(genome.getLinksChromosome().size());
case 2:
return Format.formatDouble(genome.getScore(),4);
case 3:
return Format.formatInteger(this.maxGeneration - genome.getBirthGeneration());
case 4:
return Format.formatInteger(genome.getBirthGeneration());
default :
return "String_Node_Str";
}
}
Program: 17598
Project: 17598
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  NEATSpecies species=this.population.getSpecies().get(rowIndex);
  String leader="String_Node_Str";
  if (species.getLeader() != null)   leader=Format.formatInteger((int)species.getLeader().getGenomeID());
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)species.getSpeciesID());
case 1:
  return Format.formatInteger(species.getAge());
case 2:
return Format.formatDouble(species.getBestScore(),4);
case 3:
return Format.formatInteger(species.getGensNoImprovement());
case 4:
return leader;
case 5:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  NEATSpecies species=this.population.getSpecies().get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger(species.getAge());
case 1:
  return Format.formatDouble(species.getBestScore(),4);
case 2:
return Format.formatInteger(species.getGensNoImprovement());
case 3:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}
Program: 17599
Project: 17599
Buggy source:
@Override public String getName(){
  return "String_Node_Str" + this.genome.getGenomeID();
}

Fixed version (ground truth):
@Override public String getName(){
  return "String_Node_Str";
}
Program: 17601
Project: 17601
Buggy source:
private void performEdit(){
  EditNEATPopulationDialog dialog=new EditNEATPopulationDialog();
  dialog.getOldAgePenalty().setValue(this.population.getOldAgePenalty());
  dialog.getOldAgeThreshold().setValue(this.population.getOldAgeThreshold());
  dialog.getPopulationSize().setValue(this.population.getPopulationSize());
  dialog.getSurvivalRate().setValue(this.population.getSurvivalRate());
  dialog.getYoungBonusAgeThreshold().setValue(this.population.getYoungBonusAgeThreshold());
  dialog.getYoungScoreBonus().setValue(this.population.getYoungScoreBonus());
  if (!this.population.isHyperNEAT()) {
    ActivationFunction af=population.getActivationFunctions().getList().get(0).getObj();
  }
  dialog.getActivationCycles().setValue(population.getActivationCycles());
  if (dialog.process()) {
    this.population.setOldAgePenalty(dialog.getOldAgePenalty().getValue());
    this.population.setOldAgeThreshold(dialog.getOldAgeThreshold().getValue());
    this.population.setPopulationSize(dialog.getPopulationSize().getValue());
    this.population.setSurvivalRate(dialog.getSurvivalRate().getValue());
    this.population.setYoungBonusAgeThreshhold(dialog.getYoungBonusAgeThreshold().getValue());
    this.population.setYoungScoreBonus(dialog.getYoungScoreBonus().getValue());
    if (!this.population.isHyperNEAT()) {
      this.population.setNEATActivationFunction(dialog.getNeatActivationFunction());
    }
    this.population.setActivationCycles(dialog.getActivationCycles().getValue());
    this.pi.repaint();
  }
}

Fixed version (ground truth):
private void performEdit(){
  EditNEATPopulationDialog dialog=new EditNEATPopulationDialog();
  dialog.getPopulationSize().setValue(this.population.getPopulationSize());
  dialog.getSurvivalRate().setValue(this.population.getSurvivalRate());
  if (!this.population.isHyperNEAT()) {
    ActivationFunction af=population.getActivationFunctions().getList().get(0).getObj();
  }
  dialog.getActivationCycles().setValue(population.getActivationCycles());
  if (dialog.process()) {
    this.population.setPopulationSize(dialog.getPopulationSize().getValue());
    this.population.setSurvivalRate(dialog.getSurvivalRate().getValue());
    if (!this.population.isHyperNEAT()) {
      this.population.setNEATActivationFunction(dialog.getNeatActivationFunction());
    }
    this.population.setActivationCycles(dialog.getActivationCycles().getValue());
    this.pi.repaint();
  }
}
Program: 17602
Project: 17602
Buggy source:
public void performReset(){
  String str=EncogWorkBench.getInstance().displayInput("String_Node_Str");
  try {
    int sz=Integer.parseInt(str);
    if (sz < 10) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    this.population.reset(sz);
    this.repaint();
    this.pi.repaint();
  }
 catch (  NumberFormatException ex) {
    EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
public void performReset(){
  String str=EncogWorkBench.getInstance().displayInput("String_Node_Str");
  try {
    int sz=Integer.parseInt(str);
    if (sz < 10) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    this.population.reset();
    this.repaint();
    this.pi.repaint();
  }
 catch (  NumberFormatException ex) {
    EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
  }
}
Program: 17603
Project: 17603
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.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";
}
}

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.getScore(),4);
default :
return "String_Node_Str";
}
}
Program: 17604
Project: 17604
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  NEATSpecies species=this.population.getSpecies().get(rowIndex);
  String leader="String_Node_Str";
  if (species.getLeader() != null)   leader=Format.formatInteger((int)species.getLeader().getGenomeID());
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)species.getSpeciesID());
case 1:
  return Format.formatInteger(species.getAge());
case 2:
return Format.formatDouble(species.getBestScore(),4);
case 3:
return Format.formatInteger(species.getGensNoImprovement());
case 4:
return leader;
case 5:
return Format.formatInteger(species.getMembers().size());
case 6:
return Format.formatDouble(species.getSpawnsRequired(),2);
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  NEATSpecies species=this.population.getSpecies().get(rowIndex);
  String leader="String_Node_Str";
  if (species.getLeader() != null)   leader=Format.formatInteger((int)species.getLeader().getGenomeID());
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)species.getSpeciesID());
case 1:
  return Format.formatInteger(species.getAge());
case 2:
return Format.formatDouble(species.getBestScore(),4);
case 3:
return Format.formatInteger(species.getGensNoImprovement());
case 4:
return leader;
case 5:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}
Program: 17605
Project: 17605
Buggy source:
public EPLPopulationModel(PrgPopulation population){
  this.population=population;
}

Fixed version (ground truth):
public EPLPopulationModel(PrgPopulation population){
  this.population=population;
  this.list=this.population.flatten();
}
Program: 17606
Project: 17606
Buggy source:
public int getRowCount(){
  return this.population.getGenomes().size();
}

Fixed version (ground truth):
public int getRowCount(){
  return this.list.size();
}
Program: 17607
Project: 17607
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  EncogProgram genome=(EncogProgram)this.population.getGenomes().get(rowIndex);
  RenderCommonExpression render=new RenderCommonExpression();
switch (columnIndex) {
case 0:
    return "String_Node_Str" + rowIndex;
case 1:
  return Format.formatInteger(genome.getProgramLength());
case 2:
if (Double.isNaN(genome.getScore()) || Double.isInfinite(genome.getScore())) {
  return "String_Node_Str";
}
 else {
  return Format.formatDouble(genome.getScore(),4);
}
case 3:
if (Double.isNaN(genome.getAdjustedScore()) || Double.isInfinite(genome.getAdjustedScore())) {
return "String_Node_Str";
}
 else {
return Format.formatDouble(genome.getAdjustedScore(),4);
}
case 4:
return render.render(genome);
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  EncogProgram genome=(EncogProgram)list.get(rowIndex);
  RenderCommonExpression render=new RenderCommonExpression();
switch (columnIndex) {
case 0:
    return "String_Node_Str" + rowIndex;
case 1:
  return Format.formatInteger(genome.getProgramLength());
case 2:
if (Double.isNaN(genome.getScore()) || Double.isInfinite(genome.getScore())) {
  return "String_Node_Str";
}
 else {
  return Format.formatDouble(genome.getScore(),4);
}
case 3:
if (Double.isNaN(genome.getAdjustedScore()) || Double.isInfinite(genome.getAdjustedScore())) {
return "String_Node_Str";
}
 else {
return Format.formatDouble(genome.getAdjustedScore(),4);
}
case 4:
return render.render(genome);
default :
return "String_Node_Str";
}
}
Program: 17608
Project: 17608
Buggy source:
public GeneralPopulationModel(NEATPopulation population){
  this.population=population;
  this.maxGeneration=0;
  for (  Genome g : population.getGenomes()) {
    NEATGenome genome=(NEATGenome)g;
    this.maxGeneration=Math.max(this.maxGeneration,genome.getBirthGeneration());
  }
}

Fixed version (ground truth):
public GeneralPopulationModel(NEATPopulation population){
  this.population=population;
  this.maxGeneration=0;
  this.list=this.population.flatten();
  for (  Genome g : list) {
    NEATGenome genome=(NEATGenome)g;
    this.maxGeneration=Math.max(this.maxGeneration,genome.getBirthGeneration());
  }
}
Program: 17609
Project: 17609
Buggy source:
public int getRowCount(){
  return this.population.getGenomes().size();
}

Fixed version (ground truth):
public int getRowCount(){
  return this.list.size();
}
Program: 17610
Project: 17610
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  NEATGenome genome=(NEATGenome)this.population.getGenomes().get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger(genome.getNeuronsChromosome().size());
case 1:
  return Format.formatInteger(genome.getLinksChromosome().size());
case 2:
return Format.formatDouble(genome.getScore(),4);
case 3:
return Format.formatInteger(this.maxGeneration - genome.getBirthGeneration());
case 4:
return Format.formatInteger(genome.getBirthGeneration());
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  NEATGenome genome=(NEATGenome)this.list.get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger(genome.getNeuronsChromosome().size());
case 1:
  return Format.formatInteger(genome.getLinksChromosome().size());
case 2:
return Format.formatDouble(genome.getScore(),4);
case 3:
return Format.formatInteger(this.maxGeneration - genome.getBirthGeneration());
case 4:
return Format.formatInteger(genome.getBirthGeneration());
default :
return "String_Node_Str";
}
}
Program: 17611
Project: 17611
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  NEATSpecies species=this.population.getSpecies().get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger(species.getAge());
case 1:
  return Format.formatDouble(species.getBestScore(),4);
case 2:
return Format.formatInteger(species.getGensNoImprovement());
case 3:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  Species species=this.population.getSpecies().get(rowIndex);
switch (columnIndex) {
case 0:
    return Format.formatInteger(species.getAge());
case 1:
  return Format.formatDouble(species.getBestScore(),4);
case 2:
return Format.formatInteger(species.getGensNoImprovement());
case 3:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}
Program: 17612
Project: 17612
Buggy source:
public void paint(Graphics g){
  g.setColor(Color.LIGHT_GRAY);
  g.fillRect(0,0,getWidth() - 1,getHeight() - 1);
  g.setColor(Color.black);
  g.drawRect(0,0,getWidth() - 1,getHeight() - 1);
  g.setFont(WorkbenchFonts.getTitle2Font());
  FontMetrics fm=g.getFontMetrics();
  int y=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  int populationSize=0;
  if (population.getGenomes() != null)   populationSize=population.getGenomes().size();
  y=fm.getHeight();
  g.setFont(WorkbenchFonts.getTextFont());
  g.drawString(Format.formatInteger(population.getPopulationSize()),200,y);
  g.drawString(Format.formatInteger(population.getMaxIndividualSize()),450,y);
}

Fixed version (ground truth):
public void paint(Graphics g){
  g.setColor(Color.LIGHT_GRAY);
  g.fillRect(0,0,getWidth() - 1,getHeight() - 1);
  g.setColor(Color.black);
  g.drawRect(0,0,getWidth() - 1,getHeight() - 1);
  g.setFont(WorkbenchFonts.getTitle2Font());
  FontMetrics fm=g.getFontMetrics();
  int y=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  g.drawString("String_Node_Str",300,y);
  g.drawString("String_Node_Str",580,y);
  y+=fm.getHeight();
  g.drawString("String_Node_Str",20,y);
  int populationSize=0;
  populationSize=population.flatten().size();
  y=fm.getHeight();
  g.setFont(WorkbenchFonts.getTextFont());
  g.drawString(Format.formatInteger(population.getPopulationSize()),200,y);
  g.drawString(Format.formatInteger(population.getMaxIndividualSize()),450,y);
}
Program: 17613
Project: 17613
Buggy source:
private void performSort(){
  this.population.sort(new MinimizeScoreComp());
  this.populationTable.repaint();
}

Fixed version (ground truth):
private void performSort(){
  this.populationTable.repaint();
}
Program: 17615
Project: 17615
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  try {
    if (e.getClickCount() == 2) {
      JTable target=(JTable)e.getSource();
      int row=target.getSelectedRow();
      if (target == this.populationTable) {
        EncogProgram genome=(EncogProgram)this.population.get(row);
        EncogProgramTab tab=new EncogProgramTab(genome);
        EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
      }
    }
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  try {
    if (e.getClickCount() == 2) {
      JTable target=(JTable)e.getSource();
      int row=target.getSelectedRow();
      if (target == this.populationTable) {
        EncogProgram genome=(EncogProgram)this.list.get(row);
        EncogProgramTab tab=new EncogProgramTab(genome);
        EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
      }
    }
  }
 catch (  Throwable t) {
    EncogWorkBench.displayError("String_Node_Str",t);
  }
}
Program: 17617
Project: 17617
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  if (e.getClickCount() == 2) {
    JTable target=(JTable)e.getSource();
    int row=target.getSelectedRow();
    if (target == this.populationTable) {
      NEATGenome genome=(NEATGenome)this.population.get(row);
      GenomeStructureTab tab=new GenomeStructureTab(genome);
      EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
    }
 else     if (target == this.speciesTable) {
      NEATSpecies species=this.population.getSpecies().get(row);
      NEATGenome genome=(NEATGenome)species.getLeader();
      if (genome != null) {
        GenomeStructureTab tab=new GenomeStructureTab(genome);
        EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  if (e.getClickCount() == 2) {
    JTable target=(JTable)e.getSource();
    int row=target.getSelectedRow();
    if (target == this.populationTable) {
      NEATGenome genome=(NEATGenome)this.list.get(row);
      GenomeStructureTab tab=new GenomeStructureTab(genome);
      EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
    }
 else     if (target == this.speciesTable) {
      Species species=this.population.getSpecies().get(row);
      NEATGenome genome=(NEATGenome)species.getLeader();
      if (genome != null) {
        GenomeStructureTab tab=new GenomeStructureTab(genome);
        EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
      }
    }
  }
}
Program: 17619
Project: 17619
Buggy source:
public InnovationModel(NEATPopulation population){
  this.population=population;
}

Fixed version (ground truth):
public InnovationModel(NEATPopulation population){
  this.population=population;
  this.keys=population.getInnovations().getInnovations().keySet().toArray();
}
Program: 17620
Project: 17620
Buggy source:
public Object getValueAt(int arg0,int arg1){
  Innovation innovation=this.population.getInnovations().get(arg0);
switch (arg1) {
case 0:
    return Format.formatInteger((int)innovation.getInnovationID());
case 1:
  return innovation.toString();
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int arg0,int arg1){
switch (arg1) {
case 0:
    return "String_Node_Str" + arg0;
case 1:
  return this.keys[arg0];
default :
return "String_Node_Str";
}
}
Program: 17621
Project: 17621
Buggy source:
private int calculateDepths(Map<Integer,DrawnNeuron> neuronMap){
  List<DrawnNeuron> outputList=new ArrayList<DrawnNeuron>();
  int maxDepth=0;
  int maxOutputDepth=0;
  for (int pass=0; pass < 1; pass++) {
    boolean done=false;
    while (!done) {
      done=true;
      for (      NEATLinkGene neatLinkGene : genome.getLinksChromosome()) {
        if (neatLinkGene.getFromNeuronID() != neatLinkGene.getToNeuronID()) {
          DrawnNeuron fromNeuron=neuronMap.get((int)neatLinkGene.getFromNeuronID());
          DrawnNeuron toNeuron=neuronMap.get((int)neatLinkGene.getToNeuronID());
          if (fromNeuron.getDepth() != -1) {
            int depth=fromNeuron.getDepth() + 1;
            toNeuron.setDepth(Math.max(toNeuron.getDepth(),depth));
            maxDepth=Math.max(depth,maxDepth);
            if (toNeuron.getType() == DrawnNeuronType.Output) {
              maxOutputDepth=Math.max(maxOutputDepth,depth);
              outputList.add(toNeuron);
            }
          }
 else {
            done=false;
          }
        }
      }
    }
  }
  maxDepth++;
  for (  DrawnNeuron neuron : outputList) {
    neuron.setDepth(maxDepth);
  }
  return maxDepth;
}

Fixed version (ground truth):
private int calculateDepths(Map<Integer,DrawnNeuron> neuronMap){
  List<DrawnNeuron> outputList=new ArrayList<DrawnNeuron>();
  int maxDepth=0;
  int maxOutputDepth=0;
  for (int pass=0; pass < 1; pass++) {
    boolean done=false;
    while (!done) {
      done=true;
      for (      NEATLinkGene neatLinkGene : genome.getLinksChromosome()) {
        if (neatLinkGene.getFromNeuronID() != neatLinkGene.getToNeuronID()) {
          DrawnNeuron fromNeuron=neuronMap.get((int)neatLinkGene.getFromNeuronID());
          DrawnNeuron toNeuron=neuronMap.get((int)neatLinkGene.getToNeuronID());
          if (fromNeuron.getDepth() != -1) {
            int depth=fromNeuron.getDepth() + 1;
            toNeuron.setDepth(Math.max(toNeuron.getDepth(),depth));
            maxDepth=Math.max(depth,maxDepth);
            if (toNeuron.getType() == DrawnNeuronType.Output) {
              maxOutputDepth=Math.max(maxOutputDepth,depth);
              outputList.add(toNeuron);
            }
          }
 else {
            done=false;
          }
        }
      }
    }
  }
  maxDepth++;
  for (  DrawnNeuron neuron : outputList) {
    neuron.setDepth(maxDepth);
  }
  for (  DrawnNeuron neuron : neuronMap.values()) {
    if (neuron.getDepth() == -1) {
      neuron.setDepth(0);
    }
    if (neuron.getType() == DrawnNeuronType.Input || neuron.getType() == DrawnNeuronType.Bias) {
      neuron.setDepth(0);
    }
  }
  return maxDepth;
}
Program: 17622
Project: 17622
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  EncogProgram genome=(EncogProgram)list.get(rowIndex);
  RenderCommonExpression render=new RenderCommonExpression();
switch (columnIndex) {
case 0:
    return "String_Node_Str" + rowIndex;
case 1:
  return Format.formatInteger(genome.getProgramLength());
case 2:
if (Double.isNaN(genome.getScore()) || Double.isInfinite(genome.getScore())) {
  return "String_Node_Str";
}
 else {
  return Format.formatDouble(genome.getScore(),4);
}
case 3:
if (Double.isNaN(genome.getAdjustedScore()) || Double.isInfinite(genome.getAdjustedScore())) {
return "String_Node_Str";
}
 else {
return Format.formatDouble(genome.getAdjustedScore(),4);
}
case 4:
return render.render(genome);
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  EncogProgram genome=(EncogProgram)list.get(rowIndex);
  RenderCommonExpression render=new RenderCommonExpression();
switch (columnIndex) {
case 0:
    return "String_Node_Str" + rowIndex;
case 1:
  return Format.formatInteger(genome.size());
case 2:
if (Double.isNaN(genome.getScore()) || Double.isInfinite(genome.getScore())) {
  return "String_Node_Str";
}
 else {
  return Format.formatDouble(genome.getScore(),4);
}
case 3:
if (Double.isNaN(genome.getAdjustedScore()) || Double.isInfinite(genome.getAdjustedScore())) {
return "String_Node_Str";
}
 else {
return Format.formatDouble(genome.getAdjustedScore(),4);
}
case 4:
return render.render(genome);
default :
return "String_Node_Str";
}
}
Program: 17623
Project: 17623
Buggy source:
public static void createPopulationEPL(File path,PrgPopulation pop){
  CreateEPLPopulationDialog dialog=new CreateEPLPopulationDialog();
  if (pop != null) {
    dialog.getPopulationSize().setValue(pop.size());
    for (    String varName : pop.getContext().getDefinedVariables()) {
      dialog.getInputVariables().getModel().addElement(varName);
    }
  }
 else {
    dialog.getInputVariables().getModel().addElement("String_Node_Str");
    dialog.getPopulationSize().setValue(1000);
  }
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int maxDepth=dialog.getMaxDepth().getValue();
    CalculateScore score=null;
    if (dialog.getTrainingSet() != null) {
      score=new TrainingSetScore(dialog.getTrainingSet());
    }
    EncogProgramContext context=new EncogProgramContext();
    for (int i=0; i < dialog.getInputVariables().getModel().getSize(); i++) {
      String str=(String)dialog.getInputVariables().getModel().get(i);
      context.defineVariable(str);
    }
    StandardExtensions.createNumericOperators(context.getFunctions());
    if (pop == null) {
      pop=new PrgPopulation(context,populationSize);
    }
    pop.addRewriteRule(new RewriteConstants());
    pop.addRewriteRule(new RewriteAlgebraic());
    (new PrgGrowGenerator(pop.getContext(),score,maxDepth)).generate(new Random(),pop);
    if (path != null) {
      EncogWorkBench.getInstance().save(path,pop);
      EncogWorkBench.getInstance().refresh();
    }
  }
}

Fixed version (ground truth):
public static void createPopulationEPL(File path,PrgPopulation pop){
  CreateEPLPopulationDialog dialog=new CreateEPLPopulationDialog();
  if (pop != null) {
    dialog.getPopulationSize().setValue(pop.size());
    for (    String varName : pop.getContext().getDefinedVariables()) {
      dialog.getInputVariables().getModel().addElement(varName);
    }
  }
 else {
    dialog.getInputVariables().getModel().addElement("String_Node_Str");
    dialog.getPopulationSize().setValue(1000);
  }
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int maxDepth=dialog.getMaxDepth().getValue();
    CalculateScore score=null;
    if (dialog.getTrainingSet() != null) {
      score=new TrainingSetScore(dialog.getTrainingSet());
    }
    EncogProgramContext context=new EncogProgramContext();
    for (int i=0; i < dialog.getInputVariables().getModel().getSize(); i++) {
      String str=(String)dialog.getInputVariables().getModel().get(i);
      context.defineVariable(str);
    }
    StandardExtensions.createNumericOperators(context.getFunctions());
    if (pop == null) {
      pop=new PrgPopulation(context,populationSize);
    }
    (new PrgGrowGenerator(pop.getContext(),maxDepth)).generate(new Random(),pop,new ZeroEvalScoreFunction());
    if (path != null) {
      EncogWorkBench.getInstance().save(path,pop);
      EncogWorkBench.getInstance().refresh();
    }
  }
}
Program: 17624
Project: 17624
Buggy source:
private void performPrgPopulationTrain(ProjectEGFile file,MLDataSet trainingData,MLDataSet validationData){
  TrainEPLPopulationDialog dialog=new TrainEPLPopulationDialog();
  if (dialog.process()) {
    PrgPopulation pop=(PrgPopulation)file.getObject();
    TrainEA train=new TrainEA(pop,trainingData);
    if (dialog.getSimplify().getValue()) {
      pop.addRewriteRule(new RewriteConstants());
      pop.addRewriteRule(new RewriteAlgebraic());
    }
    train.addOperation(0.95,new SubtreeCrossover());
    train.addOperation(0.05,new SubtreeMutation(pop.getContext(),4));
    ComplexityAdjustedScore adj=new ComplexityAdjustedScore(dialog.getComplexityPenaltyThreshold().getValue(),dialog.getComplexityPentaltyFullThreshold().getValue(),dialog.getComplexityPenalty().getValue(),dialog.getComplexityFullPenalty().getValue());
    train.addScoreAdjuster(adj);
    startup(file,train,0.0,validationData);
  }
}

Fixed version (ground truth):
private void performPrgPopulationTrain(ProjectEGFile file,MLDataSet trainingData,MLDataSet validationData){
  TrainEPLPopulationDialog dialog=new TrainEPLPopulationDialog();
  if (dialog.process()) {
    PrgPopulation pop=(PrgPopulation)file.getObject();
    TrainEA train=new TrainEA(pop,trainingData);
    if (dialog.getSimplify().getValue()) {
      train.addRewriteRule(new RewriteConstants());
      train.addRewriteRule(new RewriteAlgebraic());
    }
    train.addOperation(0.95,new SubtreeCrossover());
    train.addOperation(0.05,new SubtreeMutation(pop.getContext(),4));
    ComplexityAdjustedScore adj=new ComplexityAdjustedScore(dialog.getComplexityPenaltyThreshold().getValue(),dialog.getComplexityPentaltyFullThreshold().getValue(),dialog.getComplexityPenalty().getValue(),dialog.getComplexityFullPenalty().getValue());
    train.addScoreAdjuster(adj);
    startup(file,train,0.0,validationData);
  }
}
Program: 17625
Project: 17625
Buggy source:
public String transform(MappedNode node){
  int opcode=node.getTemplate().getOpcode();
  if (opcode == StandardExtensions.OPCODE_CONST_FLOAT) {
    double d=node.getConstValue().toFloatValue();
    return ("String_Node_Str" + prg.getContext().getFormat().format(d,10));
  }
 else   if (opcode == StandardExtensions.OPCODE_CONST_INT) {
    return ("String_Node_Str" + ((int)node.getParam1()));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public String transform(ProgramNode node){
  ProgramExtensionTemplate temp=node.getTemplate();
  if (temp == StandardExtensions.EXTENSION_CONST_SUPPORT) {
    return node.getData()[0].toStringValue();
  }
 else {
    return null;
  }
}
Program: 17626
Project: 17626
Buggy source:
private void buildGraph(EncogProgram prg){
  MapProgram map=new MapProgram(prg);
  MappedNode root=map.getRootNode();
  graph.addVertex(root);
  graphNode(root);
}

Fixed version (ground truth):
private void buildGraph(EncogProgram prg){
  ProgramNode root=prg.getRootNode();
  graph.addVertex(root);
  graphNode(root);
}
Program: 17627
Project: 17627
Buggy source:
private void graphNode(MappedNode parentNode){
  for (int i=parentNode.getChildren().size() - 1; i >= 0; i--) {
    MappedNode childNode=(MappedNode)parentNode.getChildren().get(i);
    graphNode(childNode);
    graph.addEdge(new Integer(edgeIndex++),parentNode,childNode);
  }
}

Fixed version (ground truth):
private void graphNode(ProgramNode parentNode){
  for (int i=parentNode.getChildNodes().size() - 1; i >= 0; i--) {
    ProgramNode childNode=(ProgramNode)parentNode.getChildNode(i);
    graphNode(childNode);
    graph.addEdge(new Integer(edgeIndex++),parentNode,childNode);
  }
}
Program: 17629
Project: 17629
Buggy source:
public static void resetEPLPopulation(PrgPopulation pop,int sz,CalculateGenomeScore score){
  pop.addRewriteRule(new RewriteConstants());
  pop.addRewriteRule(new RewriteAlgebraic());
  Random random=new Random();
  pop.getContext().getParams().setPopulationSize(sz);
  pop.getGenomeFactory().factorRandomPopulation(random,pop,score,5);
}

Fixed version (ground truth):
public static void resetEPLPopulation(PrgPopulation pop,int sz,CalculateGenomeScore score){
  pop.addRewriteRule(new RewriteConstants());
  pop.addRewriteRule(new RewriteAlgebraic());
  Random random=new Random();
  pop.getContext().getParams().setPopulationSize(sz);
  (new PrgGrowGenerator(pop.getContext(),score,5)).generate(new Random(),pop);
}
Program: 17630
Project: 17630
Buggy source:
public static void createPopulationEPL(File path,PrgPopulation pop){
  CreateEPLPopulationDialog dialog=new CreateEPLPopulationDialog();
  if (pop != null) {
    dialog.getPopulationSize().setValue(pop.size());
    for (    String varName : pop.getContext().getDefinedVariables()) {
      dialog.getInputVariables().getModel().addElement(varName);
    }
  }
 else {
    dialog.getInputVariables().getModel().addElement("String_Node_Str");
    dialog.getPopulationSize().setValue(1000);
  }
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int maxDepth=dialog.getMaxDepth().getValue();
    CalculateGenomeScore score=null;
    if (dialog.getTrainingSet() != null) {
      score=new GeneticScoreAdapter(new TrainingSetScore(dialog.getTrainingSet()));
    }
    EncogProgramContext context=new EncogProgramContext();
    for (int i=0; i < dialog.getInputVariables().getModel().getSize(); i++) {
      String str=(String)dialog.getInputVariables().getModel().get(i);
      context.defineVariable(str);
    }
    StandardExtensions.createNumericOperators(context.getFunctions());
    if (pop == null) {
      pop=new PrgPopulation(context);
    }
    pop.addRewriteRule(new RewriteConstants());
    pop.addRewriteRule(new RewriteAlgebraic());
    pop.getContext().getParams().setPopulationSize(populationSize);
    (new PrgGrowGenerator(pop.getContext(),score,maxDepth)).generate(new Random(),pop);
    if (path != null) {
      EncogWorkBench.getInstance().save(path,pop);
      EncogWorkBench.getInstance().refresh();
    }
  }
}

Fixed version (ground truth):
public static void createPopulationEPL(File path,PrgPopulation pop){
  CreateEPLPopulationDialog dialog=new CreateEPLPopulationDialog();
  if (pop != null) {
    dialog.getPopulationSize().setValue(pop.size());
    for (    String varName : pop.getContext().getDefinedVariables()) {
      dialog.getInputVariables().getModel().addElement(varName);
    }
  }
 else {
    dialog.getInputVariables().getModel().addElement("String_Node_Str");
    dialog.getPopulationSize().setValue(1000);
  }
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int maxDepth=dialog.getMaxDepth().getValue();
    CalculateScore score=null;
    if (dialog.getTrainingSet() != null) {
      score=new TrainingSetScore(dialog.getTrainingSet());
    }
    EncogProgramContext context=new EncogProgramContext();
    for (int i=0; i < dialog.getInputVariables().getModel().getSize(); i++) {
      String str=(String)dialog.getInputVariables().getModel().get(i);
      context.defineVariable(str);
    }
    StandardExtensions.createNumericOperators(context.getFunctions());
    if (pop == null) {
      pop=new PrgPopulation(context);
    }
    pop.addRewriteRule(new RewriteConstants());
    pop.addRewriteRule(new RewriteAlgebraic());
    pop.getContext().getParams().setPopulationSize(populationSize);
    (new PrgGrowGenerator(pop.getContext(),score,maxDepth)).generate(new Random(),pop);
    if (path != null) {
      EncogWorkBench.getInstance().save(path,pop);
      EncogWorkBench.getInstance().refresh();
    }
  }
}
Program: 17631
Project: 17631
Buggy source:
private void performRescore(){
  RescoreDialog dialog=new RescoreDialog();
  if (dialog.process()) {
    List<AdjustScore> adjusters=new ArrayList<AdjustScore>();
    CalculateGenomeScore score=new GeneticScoreAdapter(new TrainingSetScore(dialog.getTrainingSet()));
    ParallelScore ps=new ParallelScore(this.population,adjusters,score,0);
    ps.process();
    this.populationTable.repaint();
  }
}

Fixed version (ground truth):
private void performRescore(){
  RescoreDialog dialog=new RescoreDialog();
  if (dialog.process()) {
    List<AdjustScore> adjusters=new ArrayList<AdjustScore>();
    CalculateScore score=new TrainingSetScore(dialog.getTrainingSet());
    ParallelScore ps=new ParallelScore(this.population,new PrgCODEC(),adjusters,score,0);
    ps.process();
    this.populationTable.repaint();
  }
}
Program: 17632
Project: 17632
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.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 ActivationSteepenedSigmoid());
  this.setOutputActivationFunction(new ActivationLinear());
}

Fixed version (ground truth):
public NewPopulationDialog(){
  super(EncogWorkBench.getInstance().getMainWindow());
  this.setSize(500,300);
  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.neatActivationField=new PopupField("String_Node_Str","String_Node_Str",true));
  render();
  this.setNeatActivationFunction(new ActivationSteepenedSigmoid());
}
Program: 17633
Project: 17633
Buggy source:
public String popup(PopupField field){
  if (field == this.outputActivationField) {
    ActivationDialog dialog=new ActivationDialog(EncogWorkBench.getInstance().getMainWindow());
    dialog.setActivation(this.outputActivationFunction);
    if (!dialog.process())     return null;
 else {
      this.outputActivationFunction=dialog.getActivation();
      return dialog.getActivation().getClass().getSimpleName();
    }
  }
 else   if (field == this.neatActivationField) {
    ActivationDialog dialog=new ActivationDialog(EncogWorkBench.getInstance().getMainWindow());
    dialog.setActivation(this.neatActivationFunction);
    if (!dialog.process())     return null;
 else {
      this.neatActivationFunction=dialog.getActivation();
      return dialog.getActivation().getClass().getSimpleName();
    }
  }
 else   return null;
}

Fixed version (ground truth):
public String popup(PopupField field){
  if (field == this.neatActivationField) {
    ActivationDialog dialog=new ActivationDialog(EncogWorkBench.getInstance().getMainWindow());
    dialog.setActivation(this.neatActivationFunction);
    if (!dialog.process())     return null;
 else {
      this.neatActivationFunction=dialog.getActivation();
      return dialog.getActivation().getClass().getSimpleName();
    }
  }
 else   return null;
}
Program: 17634
Project: 17634
Buggy source:
public void openEGFile(ProjectEGFile file){
  file.refresh();
  Object obj=file.getObject();
  EncogCommonTab tab=null;
  if (obj instanceof BayesianNetwork) {
    tab=new BayesianNetworkTab(file);
  }
 else   if (obj instanceof PrgPopulation) {
    tab=new EPLPopulationTab(file);
  }
 else   if (obj instanceof MLMethod) {
    tab=new MLMethodTab(file);
  }
 else   if (obj instanceof NEATPopulation) {
    tab=new NEATPopulationTab(file);
  }
 else   if (obj instanceof TrainingContinuation) {
    tab=new TrainingContTab(file);
  }
 else {
    tab=new UnknownObjectTab(file);
  }
  if (tab != null)   this.tabManager.openTab(tab);
}

Fixed version (ground truth):
public void openEGFile(ProjectEGFile file){
  file.refresh();
  Object obj=file.getObject();
  EncogCommonTab tab=null;
  if (obj instanceof BayesianNetwork) {
    tab=new BayesianNetworkTab(file);
  }
 else   if (obj instanceof PrgPopulation) {
    tab=new EPLPopulationTab(file);
  }
 else   if (obj instanceof NEATPopulation) {
    tab=new NEATPopulationTab(file);
  }
 else   if (obj instanceof TrainingContinuation) {
    tab=new TrainingContTab(file);
  }
 else   if (obj instanceof MLMethod) {
    tab=new MLMethodTab(file);
  }
 else {
    tab=new UnknownObjectTab(file);
  }
  if (tab != null)   this.tabManager.openTab(tab);
}
Program: 17635
Project: 17635
Buggy source:
public void performTrain(){
  TrainDialog dialog=new TrainDialog(true);
  if (mlMethod != null)   dialog.setMethod(mlMethod);
  if (dialog.process()) {
    Object obj=dialog.getMethodOrPopulation();
    if (obj instanceof MLMethod) {
      MLMethod method=(MLMethod)obj;
      MLDataSet trainingData=dialog.getTrainingSet();
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performMethodTrain(method,trainingData,file,dialog.getValidationSet());
    }
 else {
      NEATPopulation population=(NEATPopulation)obj;
      MLDataSet trainingData=dialog.getTrainingSet();
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performNEATTrain(population,trainingData,file,dialog.getValidationSet());
    }
  }
}

Fixed version (ground truth):
public void performTrain(){
  TrainDialog dialog=new TrainDialog(true);
  if (mlMethod != null)   dialog.setMethod(mlMethod);
  if (dialog.process()) {
    Object obj=dialog.getMethodOrPopulation();
    if (obj instanceof NEATPopulation) {
      NEATPopulation population=(NEATPopulation)obj;
      MLDataSet trainingData=dialog.getTrainingSet();
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performNEATTrain(population,trainingData,file,dialog.getValidationSet());
    }
 else     if (obj instanceof MLMethod) {
      MLMethod method=(MLMethod)obj;
      MLDataSet trainingData=dialog.getTrainingSet();
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performMethodTrain(method,trainingData,file,dialog.getValidationSet());
    }
  }
}
Program: 17636
Project: 17636
Buggy source:
public Object getValueAt(int rowIndex,int columnIndex){
  Species species=this.population.getSpecies().get(rowIndex);
  String leader="String_Node_Str";
  if (species.getLeader() != null)   leader=Format.formatInteger((int)species.getLeader().getGenomeID());
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)species.getSpeciesID());
case 1:
  return Format.formatInteger(species.getAge());
case 2:
return Format.formatDouble(species.getBestScore(),4);
case 3:
return Format.formatInteger(species.getGensNoImprovement());
case 4:
return leader;
case 5:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public Object getValueAt(int rowIndex,int columnIndex){
  NEATSpecies species=this.population.getSpecies().get(rowIndex);
  String leader="String_Node_Str";
  if (species.getLeader() != null)   leader=Format.formatInteger((int)species.getLeader().getGenomeID());
switch (columnIndex) {
case 0:
    return Format.formatInteger((int)species.getSpeciesID());
case 1:
  return Format.formatInteger(species.getAge());
case 2:
return Format.formatDouble(species.getBestScore(),4);
case 3:
return Format.formatInteger(species.getGensNoImprovement());
case 4:
return leader;
case 5:
return Format.formatInteger(species.getMembers().size());
default :
return "String_Node_Str";
}
}
Program: 17637
Project: 17637
Buggy source:
public SpeciesModel(Population population){
  this.population=population;
}

Fixed version (ground truth):
public SpeciesModel(NEATPopulation population){
  this.population=population;
}
Program: 17638
Project: 17638
Buggy source:
@Override public void mouseClicked(MouseEvent e){
  if (e.getClickCount() == 2) {
    JTable target=(JTable)e.getSource();
    int row=target.getSelectedRow();
    if (target == this.populationTable) {
      NEATGenome genome=(NEATGenome)this.population.get(row);
      GenomeStructureTab tab=new GenomeStructureTab(genome);
      EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
    }
 else     if (target == this.speciesTable) {
      Species species=(Species)this.population.getSpecies().get(row);
      NEATGenome genome=(NEATGenome)species.getLeader();
      if (genome != null) {
        GenomeStructureTab tab=new GenomeStructureTab(genome);
        EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void mouseClicked(MouseEvent e){
  if (e.getClickCount() == 2) {
    JTable target=(JTable)e.getSource();
    int row=target.getSelectedRow();
    if (target == this.populationTable) {
      NEATGenome genome=(NEATGenome)this.population.get(row);
      GenomeStructureTab tab=new GenomeStructureTab(genome);
      EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
    }
 else     if (target == this.speciesTable) {
      NEATSpecies species=this.population.getSpecies().get(row);
      NEATGenome genome=(NEATGenome)species.getLeader();
      if (genome != null) {
        GenomeStructureTab tab=new GenomeStructureTab(genome);
        EncogWorkBench.getInstance().getMainWindow().getTabManager().openTab(tab);
      }
    }
  }
}
Program: 17639
Project: 17639
Buggy source:
private static void createPopulationEPL(File path){
  CreateEPLPopulationDialog dialog=new CreateEPLPopulationDialog();
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int inputCount=dialog.getInputSize().getValue();
    EncogProgramContext context=new EncogProgramContext();
    context.defineVariable("String_Node_Str");
    StandardExtensions.createNumericOperators(context.getFunctions());
    PrgGenomeFactory genomeFactory=new PrgGenomeFactory(context);
    PrgPopulation pop=new PrgPopulation(context,genomeFactory);
    pop.addRewriteRule(new RewriteConstants());
    pop.addRewriteRule(new RewriteAlgebraic());
    Random random=new Random();
    pop.getGenomeFactory().factorRandomPopulation(random,pop,new EmptyScoreFunction(),5);
    EncogWorkBench.getInstance().save(path,pop);
    EncogWorkBench.getInstance().refresh();
  }
}

Fixed version (ground truth):
private static void createPopulationEPL(File path){
  CreateEPLPopulationDialog dialog=new CreateEPLPopulationDialog();
  if (dialog.process()) {
    int populationSize=dialog.getPopulationSize().getValue();
    int inputCount=dialog.getInputSize().getValue();
    EncogProgramContext context=new EncogProgramContext();
    context.defineVariable("String_Node_Str");
    StandardExtensions.createNumericOperators(context.getFunctions());
    PrgPopulation pop=new PrgPopulation(context);
    pop.addRewriteRule(new RewriteConstants());
    pop.addRewriteRule(new RewriteAlgebraic());
    Random random=new Random();
    pop.getGenomeFactory().factorRandomPopulation(random,pop,new EmptyScoreFunction(),5);
    EncogWorkBench.getInstance().save(path,pop);
    EncogWorkBench.getInstance().refresh();
  }
}
Program: 17640
Project: 17640
Buggy source:
public InnovationModel(Population population){
  this.population=population;
}

Fixed version (ground truth):
public InnovationModel(NEATPopulation population){
  this.population=population;
}