nus-yam/ex-repair huggingface dataset:
Program: 64525
Project: 64525
Buggy source:
@Override public void run(){
  boolean isThreadNeeded=true;
  long alreadyConsumed=0;
  while (isThreadNeeded) {
    if (alreadyConsumed > period) {
      long realConsumption=alreadyConsumed;
      long missed=alreadyConsumed / period;
      alreadyConsumed=alreadyConsumed % period;
      log.warning("String_Node_Str" + realConsumption + "String_Node_Str"+ period+ "String_Node_Str"+ missed+ "String_Node_Str"+ alreadyConsumed);
    }
 else {
    }
    try {
      Thread.sleep(period - alreadyConsumed);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    long measureStart=System.currentTimeMillis();
    PullMeasure<Value> pull=weakPull.get();
    SimplePushMeasure<Value> push=weakPush.get();
    if (pull == null || push == null) {
      isThreadNeeded=false;
    }
 else {
      Value value=pull.get();
      if (value == lastValue || value != null && value.equals(lastValue)) {
      }
 else {
        lastValue=value;
        push.push(value);
      }
    }
    pull=null;
    push=null;
    long measureEnd=System.currentTimeMillis();
    alreadyConsumed=measureEnd - measureStart;
  }
}

Fixed version (ground truth):
@Override public void run(){
  boolean isThreadNeeded=true;
  long alreadyConsumed=0;
  while (isThreadNeeded) {
    if (alreadyConsumed > period) {
      long realConsumption=alreadyConsumed;
      long missed=alreadyConsumed / period;
      alreadyConsumed=alreadyConsumed % period;
      log.warning("String_Node_Str" + realConsumption + "String_Node_Str"+ period+ "String_Node_Str"+ missed+ "String_Node_Str"+ alreadyConsumed);
    }
 else {
    }
    try {
      Thread.sleep(period - alreadyConsumed);
    }
 catch (    InterruptedException e) {
      throw new JMetalException("String_Node_Str",e);
    }
    long measureStart=System.currentTimeMillis();
    PullMeasure<Value> pull=weakPull.get();
    SimplePushMeasure<Value> push=weakPush.get();
    if (pull == null || push == null) {
      isThreadNeeded=false;
    }
 else {
      Value value=pull.get();
      if (value == lastValue || value != null && value.equals(lastValue)) {
      }
 else {
        lastValue=value;
        push.push(value);
      }
    }
    pull=null;
    push=null;
    long measureEnd=System.currentTimeMillis();
    alreadyConsumed=measureEnd - measureStart;
  }
}
Program: 64526
Project: 64526
Buggy source:
private void readDataFromFile(String path,Vector<Vector<Double>> data,int algorithmIndex){
  String string="String_Node_Str";
  try {
    FileInputStream fis=new FileInputStream(path);
    byte[] bytes=new byte[4096];
    int readBytes=0;
    while (readBytes != -1) {
      readBytes=fis.read(bytes);
      if (readBytes != -1) {
        string+=new String(bytes,0,readBytes);
      }
    }
    fis.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
    System.exit(-1);
  }
  StringTokenizer lines=new StringTokenizer(string,"String_Node_Str");
  double valor=0.0;
  int n=0;
  while (lines.hasMoreTokens()) {
    valor=valor + Double.parseDouble(lines.nextToken());
    n++;
  }
  if (n != 0) {
    (data.elementAt(algorithmIndex)).add(valor / n);
  }
 else {
    (data.elementAt(algorithmIndex)).add(valor);
  }
}

Fixed version (ground truth):
private void readDataFromFile(String path,Vector<Vector<Double>> data,int algorithmIndex){
  String string="String_Node_Str";
  try {
    FileInputStream fis=new FileInputStream(path);
    byte[] bytes=new byte[4096];
    int readBytes=0;
    while (readBytes != -1) {
      readBytes=fis.read(bytes);
      if (readBytes != -1) {
        string+=new String(bytes,0,readBytes);
      }
    }
    fis.close();
  }
 catch (  IOException e) {
    throw new JMetalException("String_Node_Str",e);
  }
  StringTokenizer lines=new StringTokenizer(string,"String_Node_Str");
  double valor=0.0;
  int n=0;
  while (lines.hasMoreTokens()) {
    valor=valor + Double.parseDouble(lines.nextToken());
    n++;
  }
  if (n != 0) {
    (data.elementAt(algorithmIndex)).add(valor / n);
  }
 else {
    (data.elementAt(algorithmIndex)).add(valor);
  }
}
Program: 64527
Project: 64527
Buggy source:
/** 
 * Write the file contents in the output file
 * @param indicator
 * @param fileContents
 */
private void writeLatexFile(QualityIndicator indicator,String fileContents){
  String outputFile=latexDirectoryName + "String_Node_Str" + indicator.getName()+ "String_Node_Str";
  try {
    File latexOutput;
    latexOutput=new File(latexDirectoryName);
    if (!latexOutput.exists()) {
      latexOutput.mkdirs();
    }
    FileOutputStream fileOutputStream=new FileOutputStream(outputFile);
    DataOutputStream dataOutputStream=new DataOutputStream(fileOutputStream);
    dataOutputStream.writeBytes(fileContents);
    dataOutputStream.close();
    fileOutputStream.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
    System.exit(-1);
  }
}

Fixed version (ground truth):
/** 
 * Write the file contents in the output file
 * @param indicator
 * @param fileContents
 */
private void writeLatexFile(QualityIndicator indicator,String fileContents){
  String outputFile=latexDirectoryName + "String_Node_Str" + indicator.getName()+ "String_Node_Str";
  try {
    File latexOutput;
    latexOutput=new File(latexDirectoryName);
    if (!latexOutput.exists()) {
      latexOutput.mkdirs();
    }
    FileOutputStream fileOutputStream=new FileOutputStream(outputFile);
    DataOutputStream dataOutputStream=new DataOutputStream(fileOutputStream);
    dataOutputStream.writeBytes(fileContents);
    dataOutputStream.close();
    fileOutputStream.close();
  }
 catch (  IOException e) {
    throw new JMetalException("String_Node_Str",e);
  }
}
Program: 64534
Project: 64534
Buggy source:
/** 
 * Deletes a file or directory if it does exist
 * @param file
 */
private void resetFile(String file){
  File f=new File(file);
  if (f.exists()) {
    System.out.println("String_Node_Str" + file + "String_Node_Str");
    if (f.isDirectory()) {
      System.out.println("String_Node_Str" + file + "String_Node_Str");
      if (f.delete()) {
        System.out.println("String_Node_Str");
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
 else {
      System.out.println("String_Node_Str" + file + "String_Node_Str");
      if (f.delete()) {
        System.out.println("String_Node_Str");
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
 else {
    System.out.println("String_Node_Str" + file + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Deletes a file or directory if it does exist
 * @param file
 */
private void resetFile(String file){
  File f=new File(file);
  if (f.exists()) {
    JMetalLogger.logger.info("String_Node_Str" + file + "String_Node_Str");
    if (f.isDirectory()) {
      JMetalLogger.logger.info("String_Node_Str" + file + "String_Node_Str");
      if (f.delete()) {
        JMetalLogger.logger.info("String_Node_Str");
      }
 else {
        JMetalLogger.logger.info("String_Node_Str");
      }
    }
 else {
      JMetalLogger.logger.info("String_Node_Str" + file + "String_Node_Str");
      if (f.delete()) {
        JMetalLogger.logger.info("String_Node_Str");
      }
 else {
        JMetalLogger.logger.info("String_Node_Str");
      }
    }
  }
 else {
    JMetalLogger.logger.info("String_Node_Str" + file + "String_Node_Str");
  }
}
Program: 64537
Project: 64537
Buggy source:
public static void main(String[] args) throws IOException {
  if (args.length < 2) {
    new JMetalException("String_Node_Str");
  }
  String experimentBaseDirectory=args[0];
  List<Problem<DoubleSolution>> problemList=Arrays.<Problem<DoubleSolution>>asList(new ZDT1(),new ZDT2(),new ZDT3(),new ZDT4(),new ZDT6());
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithmList=configureAlgorithmList(problemList);
  Experiment<DoubleSolution,List<DoubleSolution>> configuration=new ExperimentBuilder<DoubleSolution,List<DoubleSolution>>("String_Node_Str").setAlgorithmList(algorithmList).setProblemList(problemList).setExperimentBaseDirectory(experimentBaseDirectory).setOutputParetoFrontFileName("String_Node_Str").setOutputParetoSetFileName("String_Node_Str").setIndicatorList(Arrays.asList(new Epsilon<DoubleSolution>(),new Spread<DoubleSolution>(),new GenerationalDistance<DoubleSolution>(),new PISAHypervolume<DoubleSolution>(),new InvertedGenerationalDistance<DoubleSolution>(),new InvertedGenerationalDistancePlus<DoubleSolution>())).setIndependentRuns(25).setNumberOfCores(8).build();
  new ExecuteAlgorithms<>(configuration).run();
  new GenerateReferenceParetoFront(configuration).run();
  new ComputeQualityIndicators<>(configuration).run();
  new GenerateLatexTablesWithStatistics(configuration).run();
  new GenerateWilcoxonTestTablesWithR<>(configuration).run();
  new GenerateBoxplotsWithR<>(configuration).setRows(3).setColumns(3).run();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  if (args.length < 2) {
    throw new JMetalException("String_Node_Str");
  }
  String experimentBaseDirectory=args[0];
  List<Problem<DoubleSolution>> problemList=Arrays.<Problem<DoubleSolution>>asList(new ZDT1(),new ZDT2(),new ZDT3(),new ZDT4(),new ZDT6());
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithmList=configureAlgorithmList(problemList);
  Experiment<DoubleSolution,List<DoubleSolution>> experiment=new ExperimentBuilder<DoubleSolution,List<DoubleSolution>>("String_Node_Str").setAlgorithmList(algorithmList).setProblemList(problemList).setExperimentBaseDirectory(experimentBaseDirectory).setOutputParetoFrontFileName("String_Node_Str").setOutputParetoSetFileName("String_Node_Str").setIndicatorList(Arrays.asList(new Epsilon<DoubleSolution>(),new Spread<DoubleSolution>(),new GenerationalDistance<DoubleSolution>(),new PISAHypervolume<DoubleSolution>(),new InvertedGenerationalDistance<DoubleSolution>(),new InvertedGenerationalDistancePlus<DoubleSolution>())).setIndependentRuns(25).setNumberOfCores(8).build();
  new ExecuteAlgorithms<>(experiment).run();
  new GenerateReferenceParetoSetAndFrontFromDoubleSolutions(experiment).run();
  new ComputeQualityIndicators<>(experiment).run();
  new GenerateLatexTablesWithStatistics(experiment).run();
  new GenerateWilcoxonTestTablesWithR<>(experiment).run();
  new GenerateFriedmanTestTables<>(experiment).run();
  new GenerateBoxplotsWithR<>(experiment).setRows(3).setColumns(3).run();
}
Program: 64538
Project: 64538
Buggy source:
private void generateLatexScript(List<List<List<List<Double>>>> data) throws IOException {
  String latexDirectoryName=configuration.getExperimentBaseDirectory() + "String_Node_Str" + DEFAULT_LATEX_DIRECTORY;
  File latexOutput;
  latexOutput=new File(latexDirectoryName);
  if (!latexOutput.exists()) {
    boolean result=new File(latexDirectoryName).mkdirs();
    System.out.println("String_Node_Str" + latexDirectoryName + "String_Node_Str");
  }
  String latexFile=latexDirectoryName + "String_Node_Str" + configuration.getExperimentName()+ "String_Node_Str";
  printHeaderLatexCommands(latexFile);
  for (int i=0; i < configuration.getIndicatorList().size(); i++) {
    printData(latexFile,i,mean,stdDeviation,"String_Node_Str");
    printData(latexFile,i,median,iqr,"String_Node_Str");
  }
  printEndLatexCommands(latexFile);
}

Fixed version (ground truth):
private void generateLatexScript(List<List<List<List<Double>>>> data) throws IOException {
  String latexDirectoryName=configuration.getExperimentBaseDirectory() + "String_Node_Str" + DEFAULT_LATEX_DIRECTORY;
  File latexOutput;
  latexOutput=new File(latexDirectoryName);
  if (!latexOutput.exists()) {
    boolean result=new File(latexDirectoryName).mkdirs();
    JMetalLogger.logger.info("String_Node_Str" + latexDirectoryName + "String_Node_Str");
  }
  String latexFile=latexDirectoryName + "String_Node_Str" + configuration.getExperimentName()+ "String_Node_Str";
  printHeaderLatexCommands(latexFile);
  for (int i=0; i < configuration.getIndicatorList().size(); i++) {
    printData(latexFile,i,mean,stdDeviation,"String_Node_Str");
    printData(latexFile,i,median,iqr,"String_Node_Str");
  }
  printEndLatexCommands(latexFile);
}
Program: 64540
Project: 64540
Buggy source:
/** 
 * Constructor
 */
public MOCHC(BinaryProblem problem,int populationSize,int maxEvaluations,int convergenceValue,double preservedPopulation,double initialConvergenceCount,CrossoverOperator<BinarySolution> crossoverOperator,MutationOperator<BinarySolution> cataclysmicMutation,SelectionOperator<List<BinarySolution>,List<BinarySolution>> newGenerationSelection,SelectionOperator<List<BinarySolution>,BinarySolution> parentSelection,SolutionListEvaluator<BinarySolution> evaluator){
  super();
  this.problem=problem;
  setMaxPopulationSize(populationSize);
  this.maxEvaluations=maxEvaluations;
  this.convergenceValue=convergenceValue;
  this.preservedPopulation=preservedPopulation;
  this.initialConvergenceCount=initialConvergenceCount;
  this.crossover=crossoverOperator;
  this.cataclysmicMutation=cataclysmicMutation;
  this.newGenerationSelection=newGenerationSelection;
  this.parentSelection=parentSelection;
  this.evaluator=evaluator;
  for (int i=0; i < problem.getNumberOfVariables(); i++) {
    size+=problem.getNumberOfBits(i);
  }
  minimumDistance=(int)Math.floor(this.initialConvergenceCount * size);
  comparator=new CrowdingDistanceComparator<BinarySolution>();
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public MOCHC(BinaryProblem problem,int populationSize,int maxEvaluations,int convergenceValue,double preservedPopulation,double initialConvergenceCount,CrossoverOperator<BinarySolution> crossoverOperator,MutationOperator<BinarySolution> cataclysmicMutation,SelectionOperator<List<BinarySolution>,List<BinarySolution>> newGenerationSelection,SelectionOperator<List<BinarySolution>,BinarySolution> parentSelection,SolutionListEvaluator<BinarySolution> evaluator){
  super();
  this.problem=problem;
  setMaxPopulationSize(populationSize);
  this.maxEvaluations=maxEvaluations;
  this.convergenceValue=convergenceValue;
  this.preservedPopulation=preservedPopulation;
  this.initialConvergenceCount=initialConvergenceCount;
  this.crossover=crossoverOperator;
  this.cataclysmicMutation=cataclysmicMutation;
  this.newGenerationSelection=newGenerationSelection;
  this.parentSelection=parentSelection;
  this.evaluator=evaluator;
  for (int i=0; i < problem.getNumberOfVariables(); i++) {
    size+=problem.getNumberOfBits(i);
  }
  minimumDistance=(int)Math.floor(this.initialConvergenceCount * size);
  System.out.println("String_Node_Str" + minimumDistance);
  comparator=new CrowdingDistanceComparator<BinarySolution>();
}
Program: 64541
Project: 64541
Buggy source:
@Override protected List<BinarySolution> replacement(List<BinarySolution> population,List<BinarySolution> offspringPopulation){
  List<BinarySolution> union=new ArrayList<>();
  union.addAll(population);
  union.addAll(offspringPopulation);
  List<BinarySolution> newPopulation=newGenerationSelection.execute(union);
  if (solutionSetsAreEquals(population,newPopulation)) {
    minimumDistance--;
  }
  if (minimumDistance <= -convergenceValue) {
    minimumDistance=(int)(1.0 / size * (1 - 1.0 / size) * size);
    int preserve=(int)Math.floor(preservedPopulation * population.size());
    newPopulation=new ArrayList<>(getMaxPopulationSize());
    Collections.sort(population,comparator);
    for (int i=0; i < preserve; i++) {
      newPopulation.add((BinarySolution)population.get(i).copy());
    }
    for (int i=preserve; i < getMaxPopulationSize(); i++) {
      BinarySolution solution=(BinarySolution)population.get(i).copy();
      cataclysmicMutation.execute(solution);
      newPopulation.add(solution);
    }
  }
  return newPopulation;
}

Fixed version (ground truth):
@Override protected List<BinarySolution> replacement(List<BinarySolution> population,List<BinarySolution> offspringPopulation){
  List<BinarySolution> union=new ArrayList<>();
  union.addAll(population);
  union.addAll(offspringPopulation);
  List<BinarySolution> newPopulation=newGenerationSelection.execute(union);
  if (SolutionListUtils.solutionListsAreEquals(population,newPopulation)) {
    minimumDistance--;
  }
  if (minimumDistance <= -convergenceValue) {
    minimumDistance=(int)(0.35 * (1 - 0.35) * size);
    int preserve=(int)Math.floor(preservedPopulation * population.size());
    newPopulation=new ArrayList<>(getMaxPopulationSize());
    Collections.sort(population,comparator);
    for (int i=0; i < preserve; i++) {
      newPopulation.add((BinarySolution)population.get(i).copy());
    }
    for (int i=preserve; i < getMaxPopulationSize(); i++) {
      BinarySolution solution=(BinarySolution)population.get(i).copy();
      cataclysmicMutation.execute(solution);
      newPopulation.add(solution);
    }
  }
  return newPopulation;
}
Program: 64543
Project: 64543
Buggy source:
/** 
 * This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem
 * @param solutionSet The front to invert
 * @return The inverted front
 */
public static <S extends Solution<?>>List<S> getInvertedFront(List<S> solutionSet){
  List<S> invertedFront=new ArrayList<>(solutionSet.size());
  int numberOfObjectives=solutionSet.get(0).getNumberOfObjectives();
  for (int i=0; i < solutionSet.size(); i++) {
    invertedFront.add(i,(S)solutionSet.get(i).copy());
    for (int j=0; j < numberOfObjectives; j++) {
      if (solutionSet.get(i).getObjective(j) <= 1.0 && solutionSet.get(i).getObjective(j) >= 0.0) {
        invertedFront.get(i).setObjective(j,1.0 - solutionSet.get(i).getObjective(j));
      }
 else       if (solutionSet.get(i).getObjective(j) > 1.0) {
        invertedFront.get(i).setObjective(j,0.0);
      }
 else       if (solutionSet.get(i).getObjective(j) < 0.0) {
        invertedFront.get(i).setObjective(j,1.0);
      }
    }
  }
  return invertedFront;
}

Fixed version (ground truth):
/** 
 * This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem
 * @param solutionSet The front to invert
 * @return The inverted front
 */
@SuppressWarnings("String_Node_Str") public static <S extends Solution<?>>List<S> getInvertedFront(List<S> solutionSet){
  List<S> invertedFront=new ArrayList<>(solutionSet.size());
  int numberOfObjectives=solutionSet.get(0).getNumberOfObjectives();
  for (int i=0; i < solutionSet.size(); i++) {
    invertedFront.add(i,(S)solutionSet.get(i).copy());
    for (int j=0; j < numberOfObjectives; j++) {
      if (solutionSet.get(i).getObjective(j) <= 1.0 && solutionSet.get(i).getObjective(j) >= 0.0) {
        invertedFront.get(i).setObjective(j,1.0 - solutionSet.get(i).getObjective(j));
      }
 else       if (solutionSet.get(i).getObjective(j) > 1.0) {
        invertedFront.get(i).setObjective(j,0.0);
      }
 else       if (solutionSet.get(i).getObjective(j) < 0.0) {
        invertedFront.get(i).setObjective(j,1.0);
      }
    }
  }
  return invertedFront;
}
Program: 64545
Project: 64545
Buggy source:
public void prune(){
  Iterator<S> iterator=getSolutionList().iterator();
  boolean removed=false;
  while (iterator.hasNext()) {
    if (!removed) {
      S element=iterator.next();
      int location2=grid.location(element);
      if (location2 == grid.getMostPopulatedHypercube()) {
        iterator.remove();
        grid.removeSolution(location2);
      }
    }
  }
}

Fixed version (ground truth):
public void prune(){
  Iterator<S> iterator=getSolutionList().iterator();
  boolean removed=false;
  while (iterator.hasNext()) {
    if (!removed) {
      S element=iterator.next();
      int location=grid.location(element);
      if (location == grid.getMostPopulatedHypercube()) {
        iterator.remove();
        grid.removeSolution(location);
        removed=true;
      }
    }
  }
}
Program: 64551
Project: 64551
Buggy source:
/** 
 * Perform the crossover operation
 * @param probability Crossover setProbability
 * @param parent1     The first parent
 * @param parent2     The second parent
 * @return An array containing the two offspring
 * @throws org.uma.jmetal.util.JMetalException
 */
public List<BinarySolution> doCrossover(double probability,BinarySolution parent1,BinarySolution parent2) throws JMetalException {
  List<BinarySolution> offspring=new ArrayList<>();
  offspring.add((BinarySolution)parent1.copy());
  offspring.add((BinarySolution)parent2.copy());
  if (randomGenerator.nextDouble() < probability) {
    for (int var=0; var < parent1.getNumberOfVariables(); var++) {
      BitSet p1=parent1.getVariableValue(var);
      BitSet p2=parent1.getVariableValue(var);
      for (int bit=0; bit < parent1.getNumberOfBits(var); bit++) {
        if ((p1.get(bit) != p2.get(bit)) && (randomGenerator.nextDouble() < 0.5)) {
          offspring.get(0).getVariableValue(var).set(bit,p2.get(bit));
          offspring.get(1).getVariableValue(var).set(bit,p1.get(bit));
        }
      }
    }
  }
  return offspring;
}

Fixed version (ground truth):
/** 
 * Perform the crossover operation
 * @param probability Crossover setProbability
 * @param parent1     The first parent
 * @param parent2     The second parent
 * @return An array containing the two offspring
 * @throws org.uma.jmetal.util.JMetalException
 */
public List<BinarySolution> doCrossover(double probability,BinarySolution parent1,BinarySolution parent2) throws JMetalException {
  List<BinarySolution> offspring=new ArrayList<>();
  offspring.add((BinarySolution)parent1.copy());
  offspring.add((BinarySolution)parent2.copy());
  if (randomGenerator.nextDouble() < probability) {
    for (int var=0; var < parent1.getNumberOfVariables(); var++) {
      BinarySet p1=parent1.getVariableValue(var);
      BinarySet p2=parent2.getVariableValue(var);
      for (int bit=0; bit < p1.size(); bit++) {
        if (p1.get(bit) != p2.get(bit)) {
          if (randomGenerator.nextDouble() < 0.5) {
            offspring.get(0).getVariableValue(var).set(bit,p2.get(bit));
            offspring.get(1).getVariableValue(var).set(bit,p1.get(bit));
          }
        }
      }
    }
  }
  return offspring;
}
Program: 64552
Project: 64552
Buggy source:
@Override public int getPopulationSize(){
  return getMaxPopulationSize();
}

Fixed version (ground truth):
public int getPopulationSize(){
  return getMaxPopulationSize();
}
Program: 64553
Project: 64553
Buggy source:
@Test public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem() throws Exception {
  DTLZ1 problem=new DTLZ1();
  CrossoverOperator<DoubleSolution> crossover;
  MutationOperator<DoubleSolution> mutation;
  SelectionOperator<List<DoubleSolution>,DoubleSolution> selection;
  JMetalRandom randomGenerator=JMetalRandom.getInstance();
  randomGenerator.setSeed(1450278534242L);
  double crossoverProbability=0.9;
  double crossoverDistributionIndex=20.0;
  crossover=new SBXCrossover(crossoverProbability,crossoverDistributionIndex);
  double mutationProbability=1.0 / problem.getNumberOfVariables();
  double mutationDistributionIndex=20.0;
  mutation=new PolynomialMutation(mutationProbability,mutationDistributionIndex);
  selection=new BinaryTournamentSelection<DoubleSolution>(new RankingAndCrowdingDistanceComparator<DoubleSolution>());
  algorithm=new MOMBI2<>(problem,400,crossover,mutation,selection,new SequentialSolutionListEvaluator<DoubleSolution>(),"String_Node_Str");
  AlgorithmRunner algorithmRunner=new AlgorithmRunner.Executor(algorithm).execute();
  List<DoubleSolution> population=algorithm.getResult();
  assertTrue(population.size() >= 98);
  randomGenerator.setSeed(System.currentTimeMillis());
}

Fixed version (ground truth):
@Test public void shouldTheAlgorithmReturnANumberOfSolutionsWhenSolvingASimpleProblem() throws Exception {
  DTLZ1 problem=new DTLZ1();
  CrossoverOperator<DoubleSolution> crossover;
  MutationOperator<DoubleSolution> mutation;
  SelectionOperator<List<DoubleSolution>,DoubleSolution> selection;
  JMetalRandom randomGenerator=JMetalRandom.getInstance();
  randomGenerator.setSeed(1450278534242L);
  double crossoverProbability=0.9;
  double crossoverDistributionIndex=20.0;
  crossover=new SBXCrossover(crossoverProbability,crossoverDistributionIndex);
  double mutationProbability=1.0 / problem.getNumberOfVariables();
  double mutationDistributionIndex=20.0;
  mutation=new PolynomialMutation(mutationProbability,mutationDistributionIndex);
  selection=new BinaryTournamentSelection<DoubleSolution>(new RankingAndCrowdingDistanceComparator<DoubleSolution>());
  algorithm=new MOMBI2<>(problem,400,crossover,mutation,selection,new SequentialSolutionListEvaluator<DoubleSolution>(),"String_Node_Str");
  AlgorithmRunner algorithmRunner=new AlgorithmRunner.Executor(algorithm).execute();
  List<DoubleSolution> population=algorithm.getResult();
  assertTrue(population.size() >= 91);
  randomGenerator.setSeed(System.currentTimeMillis());
}
Program: 64554
Project: 64554
Buggy source:
public GAWASFGA(Problem<S> problem,int populationSize,int maxIterations,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,SelectionOperator<List<S>,S> selectionOperator,SolutionListEvaluator<S> evaluator){
  super(problem,populationSize,maxIterations,crossoverOperator,mutationOperator,selectionOperator,evaluator,null);
  this.populationSize=populationSize;
  double[][] weights=WeightVector.initUniformWeights2D(0.005,this.populationSize);
  int halfVectorSize=weights.length / 2;
  int evenVectorsSize=(weights.length % 2 == 0) ? halfVectorSize : (halfVectorSize + 1);
  int oddVectorsSize=halfVectorSize;
  double[][] evenVectors=new double[evenVectorsSize][getProblem().getNumberOfObjectives()];
  double[][] oddVectors=new double[oddVectorsSize][getProblem().getNumberOfObjectives()];
  int index=0;
  for (int i=0; i < weights.length; i=i + 2)   evenVectors[index++]=weights[i];
  index=0;
  for (int i=1; i < weights.length; i=i + 2)   oddVectors[index++]=weights[i];
  this.achievementScalarizingNadir=createUtilityFunction(this.getNadirPoint(),evenVectors);
  this.achievementScalarizingUtopia=createUtilityFunction(this.getReferencePoint(),oddVectors);
}

Fixed version (ground truth):
public GAWASFGA(Problem<S> problem,int populationSize,int maxIterations,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,SelectionOperator<List<S>,S> selectionOperator,SolutionListEvaluator<S> evaluator){
  super(problem,populationSize,maxIterations,crossoverOperator,mutationOperator,selectionOperator,evaluator,null);
  setMaxPopulationSize(populationSize);
  double[][] weights=WeightVector.initUniformWeights2D(0.005,getMaxPopulationSize());
  int halfVectorSize=weights.length / 2;
  int evenVectorsSize=(weights.length % 2 == 0) ? halfVectorSize : (halfVectorSize + 1);
  int oddVectorsSize=halfVectorSize;
  double[][] evenVectors=new double[evenVectorsSize][getProblem().getNumberOfObjectives()];
  double[][] oddVectors=new double[oddVectorsSize][getProblem().getNumberOfObjectives()];
  int index=0;
  for (int i=0; i < weights.length; i=i + 2)   evenVectors[index++]=weights[i];
  index=0;
  for (int i=1; i < weights.length; i=i + 2)   oddVectors[index++]=weights[i];
  this.achievementScalarizingNadir=createUtilityFunction(this.getNadirPoint(),evenVectors);
  this.achievementScalarizingUtopia=createUtilityFunction(this.getReferencePoint(),oddVectors);
}
Program: 64555
Project: 64555
Buggy source:
/** 
 * Constructor
 */
public SMSEMOA(Problem<S> problem,int maxEvaluations,int populationSize,double offset,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,SelectionOperator<List<S>,S> selectionOperator){
  super(problem);
  this.maxEvaluations=maxEvaluations;
  this.populationSize=populationSize;
  this.offset=offset;
  this.crossoverOperator=crossoverOperator;
  this.mutationOperator=mutationOperator;
  this.selectionOperator=selectionOperator;
  hypervolume=new Hypervolume<>();
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public SMSEMOA(Problem<S> problem,int maxEvaluations,int populationSize,double offset,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,SelectionOperator<List<S>,S> selectionOperator){
  super(problem);
  this.maxEvaluations=maxEvaluations;
  setMaxPopulationSize(populationSize);
  this.offset=offset;
  this.crossoverOperator=crossoverOperator;
  this.mutationOperator=mutationOperator;
  this.selectionOperator=selectionOperator;
  hypervolume=new Hypervolume<>();
}
Program: 64556
Project: 64556
Buggy source:
@Override protected void initProgress(){
  evaluations=populationSize;
}

Fixed version (ground truth):
@Override protected void initProgress(){
  evaluations=getMaxPopulationSize();
}
Program: 64557
Project: 64557
Buggy source:
/** 
 * Constructor
 * @param problem Problem to solve
 */
public WASFGA(Problem<S> problem,int populationSize,int maxIterations,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,SelectionOperator<List<S>,S> selectionOperator,SolutionListEvaluator<S> evaluator,List<Double> referencePoint){
  super(problem,maxIterations,crossoverOperator,mutationOperator,selectionOperator,evaluator);
  this.populationSize=populationSize;
  this.referencePoint=referencePoint;
  this.achievementScalarizingFunction=createUtilityFunction();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param problem Problem to solve
 */
public WASFGA(Problem<S> problem,int populationSize,int maxIterations,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,SelectionOperator<List<S>,S> selectionOperator,SolutionListEvaluator<S> evaluator,List<Double> referencePoint){
  super(problem,maxIterations,crossoverOperator,mutationOperator,selectionOperator,evaluator);
  setMaxPopulationSize(populationSize);
  this.referencePoint=referencePoint;
  this.achievementScalarizingFunction=createUtilityFunction();
}
Program: 64558
Project: 64558
Buggy source:
@Override public int getPopulationSize(){
  return this.populationSize;
}

Fixed version (ground truth):
@Override public int getPopulationSize(){
  return getMaxPopulationSize();
}
Program: 64559
Project: 64559
Buggy source:
public AbstractUtilityFunctionsSet<S> createUtilityFunction(){
  double[][] weights=WeightVector.initUniformWeights2D(0.005,this.populationSize);
  weights=WeightVector.invertWeights(weights,true);
  ASFWASFGA<S> aux=new ASFWASFGA<>(weights,referencePoint);
  return aux;
}

Fixed version (ground truth):
public AbstractUtilityFunctionsSet<S> createUtilityFunction(){
  double[][] weights=WeightVector.initUniformWeights2D(0.005,getMaxPopulationSize());
  weights=WeightVector.invertWeights(weights,true);
  ASFWASFGA<S> aux=new ASFWASFGA<>(weights,referencePoint);
  return aux;
}
Program: 64560
Project: 64560
Buggy source:
@Override public void run(){
  JMetalLogger.logger.info("String_Node_Str");
  prepareOutputDirectory();
  MultithreadedExperimentExecutor<S,Result> parallelExecutor;
  parallelExecutor=new MultithreadedExperimentExecutor<S,Result>(configuration.getNumberOfCores());
  parallelExecutor.start(this);
  for (  TaggedAlgorithm<Result> algorithm : configuration.getAlgorithmList()) {
    for (int i=0; i < configuration.getIndependentRuns(); i++) {
      parallelExecutor.addTask(new Object[]{algorithm,i,configuration});
    }
  }
  parallelExecutor.parallelExecution();
  parallelExecutor.stop();
}

Fixed version (ground truth):
@Override public void run(){
  JMetalLogger.logger.info("String_Node_Str");
  prepareOutputDirectory();
  MultithreadedExperimentExecutor<S,Result> parallelExecutor;
  parallelExecutor=new MultithreadedExperimentExecutor<S,Result>(configuration.getNumberOfCores());
  parallelExecutor.start(this);
  for (  TaggedAlgorithm<Result> algorithm : configuration.getAlgorithmList()) {
    parallelExecutor.addTask(new Object[]{algorithm,algorithm.getRunId(),configuration});
  }
  parallelExecutor.parallelExecution();
  parallelExecutor.stop();
}
Program: 64561
Project: 64561
Buggy source:
public Integer call() throws Exception {
  JMetalLogger.logger.info("String_Node_Str" + algorithm.getTag() + "String_Node_Str"+ algorithm.getProblem().getName()+ "String_Node_Str"+ id);
  algorithm.run();
  Result population=algorithm.getResult();
  new SolutionSetOutput((List<? extends Solution<?>>)population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext(outputDirectoryName + "String_Node_Str" + id+ "String_Node_Str")).setFunFileOutputContext(new DefaultFileOutputContext(outputDirectoryName + "String_Node_Str" + id+ "String_Node_Str")).print();
  return id;
}

Fixed version (ground truth):
public Integer call() throws Exception {
  String funFile=outputDirectoryName + "String_Node_Str" + id+ "String_Node_Str";
  String varFile=outputDirectoryName + "String_Node_Str" + id+ "String_Node_Str";
  JMetalLogger.logger.info("String_Node_Str" + algorithm.getTag() + "String_Node_Str"+ algorithm.getProblem().getName()+ "String_Node_Str"+ id+ "String_Node_Str"+ funFile);
  algorithm.run();
  Result population=algorithm.getResult();
  new SolutionSetOutput((List<? extends Solution<?>>)population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext(varFile)).setFunFileOutputContext(new DefaultFileOutputContext(funFile)).print();
  return id;
}
Program: 64562
Project: 64562
Buggy source:
public Object parallelExecution(){
  List<Future<Object>> future=null;
  try {
    future=executor.invokeAll(taskList);
  }
 catch (  InterruptedException e1) {
    JMetalLogger.logger.log(Level.SEVERE,"String_Node_Str",e1);
  }
  List<Object> resultList=new Vector<Object>();
  taskList=null;
  return null;
}

Fixed version (ground truth):
public Object parallelExecution(){
  List<Future<Object>> future=null;
  try {
    future=executor.invokeAll(taskList);
  }
 catch (  InterruptedException e1) {
    JMetalLogger.logger.log(Level.SEVERE,"String_Node_Str",e1);
  }
  List<Integer> resultList=new Vector<Integer>();
  for (  Future<Object> result : future) {
    Object returnValue=null;
    try {
      returnValue=result.get();
      resultList.add((Integer)returnValue);
    }
 catch (    InterruptedException e) {
      JMetalLogger.logger.log(Level.SEVERE,"String_Node_Str",e);
    }
catch (    ExecutionException e) {
      JMetalLogger.logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  taskList=null;
  return null;
}
Program: 64563
Project: 64563
Buggy source:
public TaggedAlgorithm(Algorithm<Result> algorithm,String tag,Problem<?> problem){
  this.algorithm=algorithm;
  this.tag=tag;
  this.problem=problem;
}

Fixed version (ground truth):
public TaggedAlgorithm(Algorithm<Result> algorithm,String tag,Problem<?> problem,int runId){
  this.algorithm=algorithm;
  this.tag=tag;
  this.problem=problem;
  this.runId=runId;
}
Program: 64564
Project: 64564
Buggy source:
public void print(){
  printObjectivesToFile(funFileContext,solutionSet);
  printVariablesToFile(varFileContext,solutionSet);
}

Fixed version (ground truth):
public void print(){
  System.out.println("String_Node_Str" + funFileContext.getFileName());
  printObjectivesToFile(funFileContext,solutionSet);
  printVariablesToFile(varFileContext,solutionSet);
}
Program: 64565
Project: 64565
Buggy source:
static List<TaggedAlgorithm<List<DoubleSolution>>> configureAlgorithmList(List<Problem<DoubleSolution>> problemList){
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithms=new ArrayList<>();
  for (int i=0; i < problemList.size(); i++) {
    Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<>(problemList.get(i),new SBXCrossover(1.0,20.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).setMaxEvaluations(25000).setPopulationSize(100).build();
    algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,"String_Node_Str",problemList.get(i)));
  }
  for (int i=0; i < problemList.size(); i++) {
    Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<>(problemList.get(i),new SBXCrossover(1.0,10.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).setMaxEvaluations(25000).setPopulationSize(100).build();
    algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,"String_Node_Str",problemList.get(i)));
  }
  for (int i=0; i < problemList.size(); i++) {
    Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<>(problemList.get(i),new SBXCrossover(1.0,50.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).setMaxEvaluations(25000).setPopulationSize(100).build();
    algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,"String_Node_Str",problemList.get(i)));
  }
  return algorithms;
}

Fixed version (ground truth):
static List<TaggedAlgorithm<List<DoubleSolution>>> configureAlgorithmList(List<Problem<DoubleSolution>> problemList){
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithms=new ArrayList<>();
  for (int run=0; run < 4; run++) {
    for (int i=0; i < problemList.size(); i++) {
      Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<>(problemList.get(i),new SBXCrossover(1.0,20.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).setMaxEvaluations(25000).setPopulationSize(100).build();
      algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,"String_Node_Str",problemList.get(i),run));
    }
    for (int i=0; i < problemList.size(); i++) {
      Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<>(problemList.get(i),new SBXCrossover(1.0,10.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).setMaxEvaluations(25000).setPopulationSize(100).build();
      algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,"String_Node_Str",problemList.get(i),run));
    }
    for (int i=0; i < problemList.size(); i++) {
      Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<>(problemList.get(i),new SBXCrossover(1.0,50.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).setMaxEvaluations(25000).setPopulationSize(100).build();
      algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,"String_Node_Str",problemList.get(i),run));
    }
  }
  return algorithms;
}
Program: 64566
Project: 64566
Buggy source:
public static void main(String[] args){
  List<Problem<DoubleSolution>> problemList=Arrays.<Problem<DoubleSolution>>asList(new ZDT1(),new ZDT2(),new ZDT3(),new ZDT4(),new ZDT6());
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithmList=configureAlgorithmList(problemList);
  ExperimentConfiguration<DoubleSolution,List<DoubleSolution>> configuration=new ExperimentConfigurationBuilder<DoubleSolution,List<DoubleSolution>>("String_Node_Str").setAlgorithmList(algorithmList).setProblemList(problemList).setExperimentBaseDirectory("String_Node_Str").setOutputParetoFrontFileName("String_Node_Str").setOutputParetoSetFileName("String_Node_Str").setIndependentRuns(4).setNumberOfCores(4).build();
  AlgorithmExecution<DoubleSolution,List<DoubleSolution>> algorithmExecution=new AlgorithmExecution<DoubleSolution,List<DoubleSolution>>(configuration);
  ExperimentalStudy study=new ExperimentalStudy.Builder(configuration).addExperiment(algorithmExecution).build();
  study.run();
}

Fixed version (ground truth):
public static void main(String[] args){
  List<Problem<DoubleSolution>> problemList=Arrays.<Problem<DoubleSolution>>asList(new ZDT1(),new ZDT2(),new ZDT3(),new ZDT4(),new ZDT6());
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithmList=configureAlgorithmList(problemList);
  ExperimentConfiguration<DoubleSolution,List<DoubleSolution>> configuration=new ExperimentConfigurationBuilder<DoubleSolution,List<DoubleSolution>>("String_Node_Str").setAlgorithmList(algorithmList).setProblemList(problemList).setExperimentBaseDirectory("String_Node_Str").setOutputParetoFrontFileName("String_Node_Str").setOutputParetoSetFileName("String_Node_Str").setIndependentRuns(2).setNumberOfCores(8).build();
  AlgorithmExecution<DoubleSolution,List<DoubleSolution>> algorithmExecution=new AlgorithmExecution<DoubleSolution,List<DoubleSolution>>(configuration);
  ExperimentalStudy study=new ExperimentalStudy.Builder(configuration).addExperiment(algorithmExecution).build();
  study.run();
}
Program: 64567
Project: 64567
Buggy source:
static List<TaggedAlgorithm<List<DoubleSolution>>> configureAlgorithmList(List<Problem<DoubleSolution>> problemList){
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithms=new ArrayList<>();
  for (int i=0; i < problemList.size(); i++) {
    Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<DoubleSolution>(problemList.get(i),new SBXCrossover(1.0,20.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).build();
    algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,problemList.get(i)));
  }
  for (int i=0; i < problemList.size(); i++) {
    Algorithm<List<DoubleSolution>> algorithm=new SPEA2Builder<DoubleSolution>(problemList.get(i),new SBXCrossover(1.0,10.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).build();
    algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,problemList.get(i)));
  }
  for (int i=0; i < problemList.size(); i++) {
    Algorithm<List<DoubleSolution>> algorithm=new SMPSOBuilder((DoubleProblem)problemList.get(i),new CrowdingDistanceArchive<DoubleSolution>(100)).build();
    algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,problemList.get(i)));
  }
  return algorithms;
}

Fixed version (ground truth):
static List<TaggedAlgorithm<List<DoubleSolution>>> configureAlgorithmList(List<Problem<DoubleSolution>> problemList){
  List<TaggedAlgorithm<List<DoubleSolution>>> algorithms=new ArrayList<>();
  for (int run=0; run < 4; run++) {
    for (int i=0; i < problemList.size(); i++) {
      Algorithm<List<DoubleSolution>> algorithm=new NSGAIIBuilder<DoubleSolution>(problemList.get(i),new SBXCrossover(1.0,20.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).build();
      algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,problemList.get(i),run));
    }
    for (int i=0; i < problemList.size(); i++) {
      Algorithm<List<DoubleSolution>> algorithm=new SPEA2Builder<DoubleSolution>(problemList.get(i),new SBXCrossover(1.0,10.0),new PolynomialMutation(1.0 / problemList.get(i).getNumberOfVariables(),20.0)).build();
      algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,problemList.get(i),run));
    }
    for (int i=0; i < problemList.size(); i++) {
      Algorithm<List<DoubleSolution>> algorithm=new SMPSOBuilder((DoubleProblem)problemList.get(i),new CrowdingDistanceArchive<DoubleSolution>(100)).build();
      algorithms.add(new TaggedAlgorithm<List<DoubleSolution>>(algorithm,problemList.get(i),run));
    }
  }
  return algorithms;
}
Program: 64568
Project: 64568
Buggy source:
/** 
 * Run method
 */
@Override public void run(){
  population=createInitialPopulation();
  evaluatePopulation(population);
  evaluations=populationSize;
  while (evaluations < maxEvaluations) {
    List<S> offspringPopulation=new ArrayList<>(populationSize);
    for (int i=0; i < populationSize; i+=2) {
      List<S> parents=new ArrayList<>(2);
      parents.add(selectionOperator.execute(population));
      parents.add(selectionOperator.execute(population));
      List<S> offspring=crossoverOperator.execute(parents);
      mutationOperator.execute(offspring.get(0));
      mutationOperator.execute(offspring.get(1));
      offspringPopulation.add(offspring.get(0));
      offspringPopulation.add(offspring.get(1));
    }
    List<S> jointPopulation=new ArrayList<>();
    jointPopulation.addAll(population);
    jointPopulation.addAll(offspringPopulation);
    Ranking<S> ranking=computeRanking(jointPopulation);
    population=crowdingDistanceSelection(ranking);
    evaluations+=populationSize;
  }
}

Fixed version (ground truth):
/** 
 * Run method
 */
@Override public void run(){
  population=createInitialPopulation();
  evaluatePopulation(population);
  evaluations=populationSize;
  while (evaluations < maxEvaluations) {
    List<S> offspringPopulation=new ArrayList<>(populationSize);
    for (int i=0; i < populationSize; i+=2) {
      List<S> parents=new ArrayList<>(2);
      parents.add(selectionOperator.execute(population));
      parents.add(selectionOperator.execute(population));
      List<S> offspring=crossoverOperator.execute(parents);
      mutationOperator.execute(offspring.get(0));
      mutationOperator.execute(offspring.get(1));
      offspringPopulation.add(offspring.get(0));
      offspringPopulation.add(offspring.get(1));
    }
    evaluatePopulation(offspringPopulation);
    List<S> jointPopulation=new ArrayList<>();
    jointPopulation.addAll(population);
    jointPopulation.addAll(offspringPopulation);
    Ranking<S> ranking=computeRanking(jointPopulation);
    population=crowdingDistanceSelection(ranking);
    evaluations+=populationSize;
  }
}
Program: 64569
Project: 64569
Buggy source:
@Override public void run(){
  swarm=createInitialSwarm();
  evaluateSwarm(swarm);
  initializeVelocity(getSwarm());
  initUniformWeight();
  initIdealPoint();
  initializeLeaders(getSwarm());
  initializeParticlesMemory(getSwarm());
  updateGlobalBest();
  initProgress();
  while (!isStoppingConditionReached()) {
    System.out.println("String_Node_Str" + iterations);
    shuffleGlobalBest();
    for (int i=0; i < getSwarm().size(); i++) {
      if (age[i] < maxAge) {
        updateVelocity(i);
      }
 else {
        resetParticle(i);
      }
      repairBounds(i);
      problem.evaluate(swarm.get(i));
      updateReference(swarm.get(i));
      updateLocalBest(i);
    }
    updateGlobalBest();
    updateProgress();
  }
}

Fixed version (ground truth):
@Override public void run(){
  swarm=createInitialSwarm();
  evaluateSwarm(swarm);
  initializeVelocity(getSwarm());
  initUniformWeight();
  initIdealPoint();
  initializeLeaders(getSwarm());
  initializeParticlesMemory(getSwarm());
  updateGlobalBest();
  initProgress();
  while (!isStoppingConditionReached()) {
    System.out.println("String_Node_Str" + iterations);
    shuffleGlobalBest();
    for (int i=0; i < getSwarm().size(); i++) {
      if (age[i] < maxAge) {
        updateVelocity(i);
        computeNewPositions(i);
      }
 else {
        resetParticle(i);
      }
      repairBounds(i);
      problem.evaluate(swarm.get(i));
      updateReference(swarm.get(i));
      updateLocalBest(i);
    }
    updateGlobalBest();
    updateProgress();
  }
}
Program: 64570
Project: 64570
Buggy source:
@Override public List<DoubleSolution> getResult(){
  return this.leaderArchive.getSolutionList();
}

Fixed version (ground truth):
@Override public List<DoubleSolution> getResult(){
  return this.epsilonArchive.getSolutionList();
}
Program: 64571
Project: 64571
Buggy source:
private int dominanceTest(Solution<?> solution1,Solution<?> solution2){
  int result;
  boolean solution1Dominates=false;
  boolean solution2Dominates=false;
  int flag;
  double value1, value2;
  for (int i=0; i < solution1.getNumberOfObjectives(); i++) {
    value1=solution1.getObjective(i);
    value2=solution2.getObjective(i);
    if (value1 / (1 + epsilon) < value2) {
      flag=-1;
    }
 else     if (value1 / (1 + epsilon) > value2) {
      flag=1;
    }
 else {
      flag=0;
    }
    if (flag == -1) {
      solution1Dominates=true;
    }
    if (flag == 1) {
      solution2Dominates=true;
    }
  }
  if (solution1Dominates == solution2Dominates) {
    result=0;
  }
 else   if (solution1Dominates) {
    result=-1;
  }
 else {
    result=1;
  }
  return result;
}

Fixed version (ground truth):
private int dominanceTest(Solution<?> solution1,Solution<?> solution2){
  int result;
  boolean solution1Dominates=false;
  boolean solution2Dominates=false;
  int flag;
  double value1, value2;
  for (int i=0; i < solution1.getNumberOfObjectives(); i++) {
    value1=solution1.getObjective(i);
    value2=solution2.getObjective(i);
    if (value1 / (1 + epsilon) < value2) {
      flag=-1;
    }
 else     if (value2 / (1 + epsilon) < value1) {
      flag=1;
    }
 else {
      flag=0;
    }
    if (flag == -1) {
      solution1Dominates=true;
    }
    if (flag == 1) {
      solution2Dominates=true;
    }
  }
  if (solution1Dominates == solution2Dominates) {
    result=0;
  }
 else   if (solution1Dominates) {
    result=-1;
  }
 else {
    result=1;
  }
  return result;
}