nus-yam/ex-repair huggingface dataset:
Program: 64633
Project: 64633
Buggy source:
public AbstractMOEAD(Problem problem,int populationSize,int resultPopulationSize,int maxEvaluations,CrossoverOperator crossoverOperator,MutationOperator mutation,FunctionType functionType,String dataDirectory,double neighborhoodSelectionProbability,int maximumNumberOfReplacedSolutions,int neighborSize){
  this.problem=problem;
  this.populationSize=populationSize;
  this.resultPopulationSize=resultPopulationSize;
  this.maxEvaluations=maxEvaluations;
  this.mutationOperator=mutation;
  this.crossoverOperator=crossoverOperator;
  this.functionType=functionType;
  this.neighborhoodSelectionProbability=neighborhoodSelectionProbability;
  this.maximumNumberOfReplacedSolutions=maximumNumberOfReplacedSolutions;
  this.neighborSize=neighborSize;
  randomGenerator=JMetalRandom.getInstance();
  population=new ArrayList<>(populationSize);
  indArray=new Solution[problem.getNumberOfObjectives()];
  neighborhood=new int[populationSize][neighborSize];
  idealPoint=new double[problem.getNumberOfObjectives()];
  lambda=new double[populationSize][problem.getNumberOfObjectives()];
}

Fixed version (ground truth):
public AbstractMOEAD(Problem problem,int populationSize,int resultPopulationSize,int maxEvaluations,CrossoverOperator crossoverOperator,MutationOperator mutation,FunctionType functionType,String dataDirectory,double neighborhoodSelectionProbability,int maximumNumberOfReplacedSolutions,int neighborSize){
  this.problem=problem;
  this.populationSize=populationSize;
  this.resultPopulationSize=resultPopulationSize;
  this.maxEvaluations=maxEvaluations;
  this.mutationOperator=mutation;
  this.crossoverOperator=crossoverOperator;
  this.functionType=functionType;
  this.dataDirectory=dataDirectory;
  this.neighborhoodSelectionProbability=neighborhoodSelectionProbability;
  this.maximumNumberOfReplacedSolutions=maximumNumberOfReplacedSolutions;
  this.neighborSize=neighborSize;
  randomGenerator=JMetalRandom.getInstance();
  population=new ArrayList<>(populationSize);
  indArray=new Solution[problem.getNumberOfObjectives()];
  neighborhood=new int[populationSize][neighborSize];
  idealPoint=new double[problem.getNumberOfObjectives()];
  lambda=new double[populationSize][problem.getNumberOfObjectives()];
}
Program: 64634
Project: 64634
Buggy source:
protected void matingSelection(Vector<Integer> listOfSolutions,int subproblemId,NeighborType neighbourType){
  int neighbourSize;
  int selectedSolution;
  int numberOfSolutionsToSelect=2;
  neighbourSize=neighborhood[subproblemId].length;
  while (listOfSolutions.size() < numberOfSolutionsToSelect) {
    int random;
    if (neighbourType == NeighborType.NEIGHBOR) {
      random=randomGenerator.nextInt(0,neighbourSize - 1);
      selectedSolution=neighborhood[subproblemId][random];
    }
 else {
      selectedSolution=randomGenerator.nextInt(0,populationSize - 1);
    }
    boolean flag=true;
    for (    Integer individualId : listOfSolutions) {
      if (individualId == selectedSolution) {
        flag=false;
        break;
      }
    }
    if (flag) {
      listOfSolutions.addElement(selectedSolution);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param listOfSolutions The set of the indexes of selected mating parents
 * @param subproblemId the id of current subproblem
 * @param neighbourType neighbour type
 */
protected void matingSelection(Vector<Integer> listOfSolutions,int subproblemId,NeighborType neighbourType){
  int neighbourSize;
  int selectedSolution;
  int numberOfSolutionsToSelect=2;
  neighbourSize=neighborhood[subproblemId].length;
  while (listOfSolutions.size() < numberOfSolutionsToSelect) {
    int random;
    if (neighbourType == NeighborType.NEIGHBOR) {
      random=randomGenerator.nextInt(0,neighbourSize - 1);
      selectedSolution=neighborhood[subproblemId][random];
    }
 else {
      selectedSolution=randomGenerator.nextInt(0,populationSize - 1);
    }
    boolean flag=true;
    for (    Integer individualId : listOfSolutions) {
      if (individualId == selectedSolution) {
        flag=false;
        break;
      }
    }
    if (flag) {
      listOfSolutions.addElement(selectedSolution);
    }
  }
}
Program: 64636
Project: 64636
Buggy source:
/** 
 * Copy constructor 
 */
public GenericBinarySolution(GenericBinarySolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (int i=0; i < problem.getNumberOfObjectives(); i++) {
    objectives.add(solution.getObjective(i));
  }
  variables=new ArrayList<>();
  for (  BinarySet var : solution.variables) {
    variables.add((BinarySet)var.clone());
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  attributes=new HashMap(solution.attributes);
}

Fixed version (ground truth):
/** 
 * Copy constructor 
 */
public GenericBinarySolution(GenericBinarySolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (int i=0; i < problem.getNumberOfObjectives(); i++) {
    objectives.add(solution.getObjective(i));
  }
  variables=new ArrayList<>();
  for (  BinarySet var : solution.variables) {
    variables.add((BinarySet)var.clone());
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  numberOfViolatedConstraints=solution.numberOfViolatedConstraints;
  attributes=new HashMap(solution.attributes);
}
Program: 64637
Project: 64637
Buggy source:
/** 
 * Copy constructor 
 */
public GenericDoubleBinarySolution(GenericDoubleBinarySolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  copyDoubleVariables(solution);
  copyBitSet(solution);
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  attributes=new HashMap(solution.attributes);
}

Fixed version (ground truth):
/** 
 * Copy constructor 
 */
public GenericDoubleBinarySolution(GenericDoubleBinarySolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  copyDoubleVariables(solution);
  copyBitSet(solution);
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  numberOfViolatedConstraints=solution.numberOfViolatedConstraints;
  attributes=new HashMap(solution.attributes);
}
Program: 64638
Project: 64638
Buggy source:
/** 
 * Copy constructor 
 */
public GenericDoubleSolution(GenericDoubleSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (  Double var : solution.variables) {
    variables.add(new Double(var));
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  attributes=new HashMap(solution.attributes);
}

Fixed version (ground truth):
/** 
 * Copy constructor 
 */
public GenericDoubleSolution(GenericDoubleSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (  Double var : solution.variables) {
    variables.add(new Double(var));
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  numberOfViolatedConstraints=solution.numberOfViolatedConstraints;
  attributes=new HashMap(solution.attributes);
}
Program: 64639
Project: 64639
Buggy source:
/** 
 * Copy constructor 
 */
public GenericIntegerDoubleSolution(GenericIntegerDoubleSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (int i=0; i < numberOfIntegerVariables; i++) {
    variables.add(new Integer((Integer)solution.getVariableValue(i)));
  }
  variables=new ArrayList<>();
  for (int i=numberOfIntegerVariables; i < (numberOfIntegerVariables + numberOfDoubleVariables); i++) {
    variables.add(new Double((Double)solution.getVariableValue(i)));
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  attributes=new HashMap(solution.attributes);
}

Fixed version (ground truth):
/** 
 * Copy constructor 
 */
public GenericIntegerDoubleSolution(GenericIntegerDoubleSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (int i=0; i < numberOfIntegerVariables; i++) {
    variables.add(new Integer((Integer)solution.getVariableValue(i)));
  }
  variables=new ArrayList<>();
  for (int i=numberOfIntegerVariables; i < (numberOfIntegerVariables + numberOfDoubleVariables); i++) {
    variables.add(new Double((Double)solution.getVariableValue(i)));
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  numberOfViolatedConstraints=solution.numberOfViolatedConstraints;
  attributes=new HashMap(solution.attributes);
}
Program: 64640
Project: 64640
Buggy source:
/** 
 * Copy Constructor 
 */
public GenericIntegerPermutationSolution(GenericIntegerPermutationSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (  List<Integer> var : solution.variables) {
    List<Integer> list=new ArrayList<>();
    for (    Integer element : var) {
      var.add(new Integer(element));
    }
    variables.add(list);
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  attributes=new HashMap(solution.attributes);
}

Fixed version (ground truth):
/** 
 * Copy Constructor 
 */
public GenericIntegerPermutationSolution(GenericIntegerPermutationSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (  List<Integer> var : solution.variables) {
    List<Integer> list=new ArrayList<>();
    for (    Integer element : var) {
      var.add(new Integer(element));
    }
    variables.add(list);
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  numberOfViolatedConstraints=solution.numberOfViolatedConstraints;
  attributes=new HashMap(solution.attributes);
}
Program: 64641
Project: 64641
Buggy source:
/** 
 * Copy constructor 
 */
public GenericIntegerSolution(GenericIntegerSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (  Integer var : solution.variables) {
    variables.add(new Integer(var));
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  attributes=new HashMap(solution.attributes);
}

Fixed version (ground truth):
/** 
 * Copy constructor 
 */
public GenericIntegerSolution(GenericIntegerSolution solution){
  problem=solution.problem;
  objectives=new ArrayList<>();
  for (  Double obj : solution.objectives) {
    objectives.add(new Double(obj));
  }
  variables=new ArrayList<>();
  for (  Integer var : solution.variables) {
    variables.add(new Integer(var));
  }
  overallConstraintViolationDegree=solution.overallConstraintViolationDegree;
  numberOfViolatedConstraints=solution.numberOfViolatedConstraints;
  attributes=new HashMap(solution.attributes);
}
Program: 64642
Project: 64642
Buggy source:
/** 
 * Constructor 
 */
public Srinivas(){
  setNumberOfVariables(2);
  setNumberOfObjectives(2);
  setNumberOfConstraints(2);
  setName("String_Node_Str");
  List<Double> lowerLimit=new ArrayList<>(getNumberOfVariables());
  List<Double> upperLimit=new ArrayList<>(getNumberOfVariables());
  for (int i=0; i < getNumberOfVariables(); i++) {
    lowerLimit.add(-4.0);
    upperLimit.add(4.0);
  }
  setLowerLimit(lowerLimit);
  setUpperLimit(upperLimit);
}

Fixed version (ground truth):
/** 
 * Constructor 
 */
public Srinivas(){
  setNumberOfVariables(2);
  setNumberOfObjectives(2);
  setNumberOfConstraints(2);
  setName("String_Node_Str");
  List<Double> lowerLimit=new ArrayList<>(getNumberOfVariables());
  List<Double> upperLimit=new ArrayList<>(getNumberOfVariables());
  for (int i=0; i < getNumberOfVariables(); i++) {
    lowerLimit.add(-20.0);
    upperLimit.add(20.0);
  }
  setLowerLimit(lowerLimit);
  setUpperLimit(upperLimit);
}
Program: 64645
Project: 64645
Buggy source:
protected List<Solution> crowdingDistanceSelection(Ranking ranking){
  CrowdingDistance crowdingDistance=new CrowdingDistance();
  List<Solution> population=new ArrayList<>(solutionsToSelect);
  int rankingIndex=0;
  while (population.size() <= solutionsToSelect) {
    if (subfrontFillsIntoThePopulation(ranking,rankingIndex,population)) {
      addRankedSolutionsToPopulation(ranking,rankingIndex,population);
      rankingIndex++;
    }
 else {
      crowdingDistance.computeDensityEstimator(ranking.getSubfront(rankingIndex));
      addLastRankedSolutionsToPopulation(ranking,rankingIndex,population);
    }
  }
  return population;
}

Fixed version (ground truth):
protected List<Solution> crowdingDistanceSelection(Ranking ranking){
  CrowdingDistance crowdingDistance=new CrowdingDistance();
  List<Solution> population=new ArrayList<>(solutionsToSelect);
  int rankingIndex=0;
  while (population.size() < solutionsToSelect) {
    if (subfrontFillsIntoThePopulation(ranking,rankingIndex,population)) {
      addRankedSolutionsToPopulation(ranking,rankingIndex,population);
      rankingIndex++;
    }
 else {
      crowdingDistance.computeDensityEstimator(ranking.getSubfront(rankingIndex));
      addLastRankedSolutionsToPopulation(ranking,rankingIndex,population);
    }
  }
  return population;
}
Program: 64646
Project: 64646
Buggy source:
/** 
 * Constructor 
 */
public DominanceComparator(){
  constraintViolationComparator=new OverallConstraintViolationComparator();
}

Fixed version (ground truth):
/** 
 * Constructor 
 */
public DominanceComparator(ConstraintViolationComparator constraintComparator){
  constraintViolationComparator=constraintComparator;
}
Program: 64647
Project: 64647
Buggy source:
@Override public List<S> evaluate(List<S> solutionList,Problem problem) throws JMetalException {
  try {
    for (int i=0; i < solutionList.size(); i++) {
      problem.evaluate(solutionList.get(i));
    }
  }
 catch (  JMetalException e) {
    JMetalLogger.logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new JMetalException("String_Node_Str");
  }
  return solutionList;
}

Fixed version (ground truth):
@Override public List<S> evaluate(List<S> solutionList,Problem problem) throws JMetalException {
  try {
    if (problem instanceof ConstrainedProblem) {
      for (int i=0; i < solutionList.size(); i++) {
        problem.evaluate(solutionList.get(i));
        ((ConstrainedProblem)problem).evaluateConstraints(solutionList.get(i));
      }
    }
 else {
      for (int i=0; i < solutionList.size(); i++) {
        problem.evaluate(solutionList.get(i));
      }
    }
  }
 catch (  JMetalException e) {
    JMetalLogger.logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new JMetalException("String_Node_Str");
  }
  return solutionList;
}
Program: 64650
Project: 64650
Buggy source:
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound));
}

Fixed version (ground truth):
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound) + 1);
}
Program: 64651
Project: 64651
Buggy source:
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound));
}

Fixed version (ground truth):
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound) + 1);
}
Program: 64652
Project: 64652
Buggy source:
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound));
}

Fixed version (ground truth):
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound) + 1);
}
Program: 64653
Project: 64653
Buggy source:
@Override protected List<Solution> replacement(List<Solution> population,List<Solution> offspringPopulation){
  List<Solution> jointPopulation=new ArrayList<>();
  jointPopulation.addAll(population);
  jointPopulation.addAll(offspringPopulation);
  Ranking ranking=computeRanking(jointPopulation);
  List<Solution> pop=new ArrayList<>();
  List<List<Solution>> fronts=new ArrayList<>();
  int rankingIndex=0;
  int candidateSolutions=0;
  while (candidateSolutions < populationSize) {
    fronts.add(ranking.getSubfront(rankingIndex));
    candidateSolutions+=ranking.getSubfront(rankingIndex).size();
    if ((pop.size() + ranking.getSubfront(rankingIndex).size()) <= populationSize)     addRankedSolutionsToPopulation(ranking,rankingIndex,population);
    rankingIndex++;
  }
  EnvironmentalSelection selection=new EnvironmentalSelection.Builder().setNumberOfObjectives(problem.getNumberOfObjectives()).setFronts(fronts).setSolutionsToSelect(populationSize).setReferencePoints(getReferencePointsCopy()).build();
  pop=selection.execute(pop);
  return pop;
}

Fixed version (ground truth):
@Override protected List<Solution> replacement(List<Solution> population,List<Solution> offspringPopulation){
  List<Solution> jointPopulation=new ArrayList<>();
  jointPopulation.addAll(population);
  jointPopulation.addAll(offspringPopulation);
  Ranking ranking=computeRanking(jointPopulation);
  List<Solution> pop=new ArrayList<>();
  List<List<Solution>> fronts=new ArrayList<>();
  int rankingIndex=0;
  int candidateSolutions=0;
  while (candidateSolutions < populationSize) {
    fronts.add(ranking.getSubfront(rankingIndex));
    candidateSolutions+=ranking.getSubfront(rankingIndex).size();
    if ((pop.size() + ranking.getSubfront(rankingIndex).size()) <= populationSize)     addRankedSolutionsToPopulation(ranking,rankingIndex,pop);
    rankingIndex++;
  }
  EnvironmentalSelection selection=new EnvironmentalSelection.Builder().setNumberOfObjectives(problem.getNumberOfObjectives()).setFronts(fronts).setSolutionsToSelect(populationSize).setReferencePoints(getReferencePointsCopy()).build();
  pop=selection.execute(pop);
  return pop;
}
Program: 64654
Project: 64654
Buggy source:
int FindNicheReferencePoint(){
  int min_size=Integer.MAX_VALUE;
  System.out.println(this.referencePoints.size());
  for (int r=0; r < this.referencePoints.size(); r+=1) {
    min_size=Math.min(min_size,this.referencePoints.get(r).MemberSize());
  }
  List<Integer> min_rps=new ArrayList<>();
  for (int r=0; r < this.referencePoints.size(); r+=1) {
    if (this.referencePoints.get(r).MemberSize() == min_size) {
      min_rps.add(r);
    }
  }
  System.out.println(min_rps.size());
  return min_rps.get(min_rps.size() > 1 ? JMetalRandom.getInstance().nextInt(0,min_rps.size() - 1) : 0);
}

Fixed version (ground truth):
int FindNicheReferencePoint(){
  int min_size=Integer.MAX_VALUE;
  for (int r=0; r < this.referencePoints.size(); r+=1) {
    min_size=Math.min(min_size,this.referencePoints.get(r).MemberSize());
  }
  List<Integer> min_rps=new ArrayList<>();
  for (int r=0; r < this.referencePoints.size(); r+=1) {
    if (this.referencePoints.get(r).MemberSize() == min_size) {
      min_rps.add(r);
    }
  }
  return min_rps.get(min_rps.size() > 1 ? JMetalRandom.getInstance().nextInt(0,min_rps.size() - 1) : 0);
}
Program: 64655
Project: 64655
Buggy source:
/** 
 * Evaluate() method 
 */
public void evaluate(DoubleSolution solution){
  double[] f=new double[getNumberOfObjectives()];
  double[] x=new double[getNumberOfVariables()];
  int k=getNumberOfVariables() - getNumberOfObjectives() + 1;
  double g=0.0;
  for (int i=getNumberOfVariables() - k; i < getNumberOfVariables(); i++) {
    g+=(x[i] - 0.5) * (x[i] - 0.5) - Math.cos(20.0 * Math.PI * (x[i] - 0.5));
  }
  g=100 * (k + g);
  for (int i=0; i < getNumberOfObjectives(); i++) {
    f[i]=(1.0 + g) * 0.5;
  }
  for (int i=0; i < getNumberOfObjectives(); i++) {
    for (int j=0; j < getNumberOfObjectives() - (i + 1); j++) {
      f[i]*=x[j];
    }
    if (i != 0) {
      int aux=getNumberOfObjectives() - (i + 1);
      f[i]*=1 - x[aux];
    }
  }
  for (int i=0; i < getNumberOfObjectives(); i++) {
    solution.setObjective(i,f[i]);
  }
}

Fixed version (ground truth):
/** 
 * Evaluate() method 
 */
public void evaluate(DoubleSolution solution){
  int numberOfVariables=getNumberOfVariables();
  int numberOfObjectives=getNumberOfObjectives();
  double[] f=new double[numberOfObjectives];
  double[] x=new double[numberOfVariables];
  int k=getNumberOfVariables() - getNumberOfObjectives() + 1;
  for (int i=0; i < numberOfVariables; i++) {
    x[i]=solution.getVariableValue(i);
  }
  double g=0.0;
  for (int i=numberOfVariables - k; i < numberOfVariables; i++) {
    g+=(x[i] - 0.5) * (x[i] - 0.5) - Math.cos(20.0 * Math.PI * (x[i] - 0.5));
  }
  g=100 * (k + g);
  for (int i=0; i < numberOfObjectives; i++) {
    f[i]=(1.0 + g) * 0.5;
  }
  for (int i=0; i < numberOfObjectives; i++) {
    for (int j=0; j < numberOfObjectives - (i + 1); j++) {
      f[i]*=x[j];
    }
    if (i != 0) {
      int aux=numberOfObjectives - (i + 1);
      f[i]*=1 - x[aux];
    }
  }
  for (int i=0; i < numberOfObjectives; i++) {
    solution.setObjective(i,f[i]);
  }
}
Program: 64656
Project: 64656
Buggy source:
/** 
 * Evaluate() method 
 */
public void evaluate(DoubleSolution solution){
  int numberOfVariables=getNumberOfVariables();
  int numberOfObjectives=getNumberOfObjectives();
  double[] f=new double[numberOfObjectives];
  double[] x=new double[numberOfVariables];
  int k=getNumberOfVariables() - getNumberOfObjectives() + 1;
  double g=0.0;
  for (int i=numberOfVariables - k; i < numberOfVariables; i++) {
    g+=(x[i] - 0.5) * (x[i] - 0.5);
  }
  for (int i=0; i < numberOfObjectives; i++) {
    f[i]=1.0 + g;
  }
  for (int i=0; i < numberOfObjectives; i++) {
    for (int j=0; j < numberOfObjectives - (i + 1); j++) {
      f[i]*=Math.cos(x[j] * 0.5 * Math.PI);
    }
    if (i != 0) {
      int aux=numberOfObjectives - (i + 1);
      f[i]*=Math.sin(x[aux] * 0.5 * Math.PI);
    }
  }
  for (int i=0; i < numberOfObjectives; i++) {
    solution.setObjective(i,f[i]);
  }
}

Fixed version (ground truth):
/** 
 * Evaluate() method 
 */
public void evaluate(DoubleSolution solution){
  int numberOfVariables=getNumberOfVariables();
  int numberOfObjectives=getNumberOfObjectives();
  double[] f=new double[numberOfObjectives];
  double[] x=new double[numberOfVariables];
  for (int i=0; i < numberOfVariables; i++) {
    x[i]=solution.getVariableValue(i);
  }
  int k=getNumberOfVariables() - getNumberOfObjectives() + 1;
  double g=0.0;
  for (int i=numberOfVariables - k; i < numberOfVariables; i++) {
    g+=(x[i] - 0.5) * (x[i] - 0.5);
  }
  for (int i=0; i < numberOfObjectives; i++) {
    f[i]=1.0 + g;
  }
  for (int i=0; i < numberOfObjectives; i++) {
    for (int j=0; j < numberOfObjectives - (i + 1); j++) {
      f[i]*=Math.cos(x[j] * 0.5 * Math.PI);
    }
    if (i != 0) {
      int aux=numberOfObjectives - (i + 1);
      f[i]*=Math.sin(x[aux] * 0.5 * Math.PI);
    }
  }
  for (int i=0; i < numberOfObjectives; i++) {
    solution.setObjective(i,f[i]);
  }
}
Program: 64657
Project: 64657
Buggy source:
/** 
 * Evaluate() method 
 */
public void evaluate(DoubleSolution solution){
  int numberOfVariables=getNumberOfVariables();
  int numberOfObjectives=getNumberOfObjectives();
  double[] f=new double[numberOfObjectives];
  double[] x=new double[numberOfVariables];
  int k=getNumberOfVariables() - getNumberOfObjectives() + 1;
  double g=0.0;
  for (int i=numberOfVariables - k; i < numberOfVariables; i++) {
    g+=(x[i] - 0.5) * (x[i] - 0.5) - Math.cos(20.0 * Math.PI * (x[i] - 0.5));
  }
  g=100.0 * (k + g);
  for (int i=0; i < numberOfObjectives; i++) {
    f[i]=1.0 + g;
  }
  for (int i=0; i < numberOfObjectives; i++) {
    for (int j=0; j < numberOfObjectives - (i + 1); j++) {
      f[i]*=java.lang.Math.cos(x[j] * 0.5 * java.lang.Math.PI);
    }
    if (i != 0) {
      int aux=numberOfObjectives - (i + 1);
      f[i]*=java.lang.Math.sin(x[aux] * 0.5 * java.lang.Math.PI);
    }
  }
  for (int i=0; i < numberOfObjectives; i++) {
    solution.setObjective(i,f[i]);
  }
}

Fixed version (ground truth):
/** 
 * Evaluate() method 
 */
public void evaluate(DoubleSolution solution){
  int numberOfVariables=getNumberOfVariables();
  int numberOfObjectives=getNumberOfObjectives();
  double[] f=new double[numberOfObjectives];
  double[] x=new double[numberOfVariables];
  for (int i=0; i < numberOfVariables; i++) {
    x[i]=solution.getVariableValue(i);
  }
  int k=getNumberOfVariables() - getNumberOfObjectives() + 1;
  double g=0.0;
  for (int i=numberOfVariables - k; i < numberOfVariables; i++) {
    g+=(x[i] - 0.5) * (x[i] - 0.5) - Math.cos(20.0 * Math.PI * (x[i] - 0.5));
  }
  g=100.0 * (k + g);
  for (int i=0; i < numberOfObjectives; i++) {
    f[i]=1.0 + g;
  }
  for (int i=0; i < numberOfObjectives; i++) {
    for (int j=0; j < numberOfObjectives - (i + 1); j++) {
      f[i]*=java.lang.Math.cos(x[j] * 0.5 * java.lang.Math.PI);
    }
    if (i != 0) {
      int aux=numberOfObjectives - (i + 1);
      f[i]*=java.lang.Math.sin(x[aux] * 0.5 * java.lang.Math.PI);
    }
  }
  for (int i=0; i < numberOfObjectives; i++) {
    solution.setObjective(i,f[i]);
  }
}
Program: 64658
Project: 64658
Buggy source:
@Override public String getVariableValueString(int index){
  String result="String_Node_Str";
  for (  BitSet var : variables) {
    for (int i=0; i < var.size(); i++) {
      if (var.get(i)) {
        result+="String_Node_Str";
      }
 else {
        result+="String_Node_Str";
      }
    }
    result+="String_Node_Str";
  }
  return result;
}

Fixed version (ground truth):
@Override public String getVariableValueString(int index){
  String result="String_Node_Str";
  for (  BitSet var : variables) {
    for (int i=0; i < problem.getNumberOfBits(i); i++) {
      if (var.get(i)) {
        result+="String_Node_Str";
      }
 else {
        result+="String_Node_Str";
      }
    }
    result+="String_Node_Str";
  }
  return result;
}
Program: 64659
Project: 64659
Buggy source:
/** 
 * Constructor 
 */
private NSGAIII(Builder builder){
  problem=builder.problem;
  maxIterations=builder.maxIterations;
  populationSize=builder.populationSize;
  crossoverOperator=builder.crossoverOperator;
  mutationOperator=builder.mutationOperator;
  selectionOperator=builder.selectionOperator;
  evaluator=builder.evaluator;
  numberOfDivisions=new Vector<>(1);
  numberOfDivisions.add(12);
  Vector<ReferencePoint> referencePoints=new Vector<>();
  ReferencePoint.generateReferencePoints(referencePoints,3,numberOfDivisions);
  System.out.println("String_Node_Str" + referencePoints.size());
  System.out.println("String_Node_Str" + referencePoints.size());
  for (int i=0; i < referencePoints.size(); i++) {
    System.out.println(referencePoints.get(i).position.size());
    for (int j=0; j < referencePoints.get(i).position.size(); j++) {
      System.out.println("String_Node_Str" + referencePoints.get(i).position.get(j));
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor 
 */
private NSGAIII(Builder builder){
  problem=builder.problem;
  maxIterations=builder.maxIterations;
  populationSize=builder.populationSize;
  crossoverOperator=builder.crossoverOperator;
  mutationOperator=builder.mutationOperator;
  selectionOperator=builder.selectionOperator;
  evaluator=builder.evaluator;
  numberOfDivisions=new Vector<>(1);
  numberOfDivisions.add(12);
  Vector<ReferencePoint> referencePoints=new Vector<>();
  ReferencePoint.generateReferencePoints(referencePoints,3,numberOfDivisions);
  System.out.println("String_Node_Str" + referencePoints.size());
  System.out.println("String_Node_Str" + referencePoints.size());
  for (int i=0; i < referencePoints.size(); i++) {
    System.out.println(referencePoints.get(i).position.length);
    for (int j=0; j < referencePoints.get(i).position.length; j++) {
      System.out.println("String_Node_Str" + referencePoints.get(i).position[j]);
    }
  }
}
Program: 64660
Project: 64660
Buggy source:
private static void generateRecursive(Vector<ReferencePoint> referencePoints,ReferencePoint refPoint,int numberOfObjectives,int left,int total,int element){
  if (element == (numberOfObjectives - 1)) {
    refPoint.position.add(element,0.0);
    refPoint.position.add(element,(double)left / total);
    referencePoints.add(refPoint);
  }
 else {
    for (int i=0; i <= left; i+=1) {
      refPoint.position.add(element,0.0);
      refPoint.position.set(element,(double)i / total);
      generateRecursive(referencePoints,refPoint,numberOfObjectives,left - i,total,element + 1);
    }
  }
}

Fixed version (ground truth):
private static void generateRecursive(Vector<ReferencePoint> referencePoints,ReferencePoint refPoint,int numberOfObjectives,int left,int total,int element){
  if (element == (numberOfObjectives - 1)) {
    refPoint.position[element]=(double)left / total;
    referencePoints.add(new ReferencePoint(refPoint));
  }
 else {
    for (int i=0; i <= left; i+=1) {
      refPoint.position[element]=(double)i / total;
      generateRecursive(referencePoints,refPoint,numberOfObjectives,left - i,total,element + 1);
    }
  }
}
Program: 64661
Project: 64661
Buggy source:
/** 
 * Constructor 
 */
public ReferencePoint(int size){
  position=new Vector<>(size);
  memberSize=0;
}

Fixed version (ground truth):
public ReferencePoint(ReferencePoint point){
  position=Arrays.copyOfRange(point.position,0,point.position.length);
}
Program: 64662
Project: 64662
Buggy source:
private JMetalRandom(){
  randomGenerator=new JavaRandomGenerator();
}

Fixed version (ground truth):
private JMetalRandom(){
  randomGenerator=new ApacheRandomUtilsGenerator();
}
Program: 64663
Project: 64663
Buggy source:
@Override public int nextInt(int lowerBound,int upperBound){
  return RandomUtils.nextInt(lowerBound,upperBound);
}

Fixed version (ground truth):
@Override public int nextInt(int lowerBound,int upperBound){
  int randomValue=RandomUtils.nextInt(0,upperBound - lowerBound);
  return lowerBound + randomValue;
}
Program: 64664
Project: 64664
Buggy source:
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt() * (upperBound - lowerBound);
}

Fixed version (ground truth):
@Override public int nextInt(int lowerBound,int upperBound){
  return lowerBound + rnd.nextInt((upperBound - lowerBound));
}
Program: 64665
Project: 64665
Buggy source:
/** 
 * calculates the hypervolume of that portion of the objective space that is dominated by individual a but not by individual b
 */
double calculateHypervolumeIndicator(Solution solutionA,Solution solutionB,int d,double maximumValues[],double minimumValues[]){
  double a, b, r, max;
  double volume=0;
  double rho=2.0;
  r=rho * (maximumValues[d - 1] - minimumValues[d - 1]);
  max=minimumValues[d - 1] + r;
  a=solutionA.getObjective(d - 1);
  if (solutionB == null) {
    b=max;
  }
 else {
    b=solutionB.getObjective(d - 1);
  }
  if (d == 1) {
    if (a < b) {
      volume=(b - a) / r;
    }
 else {
      volume=0;
    }
  }
 else {
    if (a < b) {
      volume=calculateHypervolumeIndicator(solutionA,null,d - 1,maximumValues,minimumValues) * (b - a) / r;
      volume+=calculateHypervolumeIndicator(solutionA,solutionB,d - 1,maximumValues,minimumValues) * (max - b) / r;
    }
 else {
      volume=calculateHypervolumeIndicator(solutionA,solutionB,d - 1,maximumValues,minimumValues) * (max - b) / r;
    }
  }
  return (volume);
}

Fixed version (ground truth):
/** 
 * calculates the hypervolume of that portion of the objective space that is dominated by individual a but not by individual b
 */
double calculateHypervolumeIndicator(Solution solutionA,Solution solutionB,int d,double maximumValues[],double minimumValues[]){
  double a, b, r, max;
  double volume=0;
  double rho=2.0;
  r=rho * (maximumValues[d - 1] - minimumValues[d - 1]);
  max=minimumValues[d - 1] + r;
  a=solutionA.getObjective(d - 1);
  if (solutionB == null) {
    b=max;
  }
 else {
    b=solutionB.getObjective(d - 1);
  }
  if (d == 1) {
    if (a < b) {
      volume=(b - a) / r;
    }
 else {
      volume=0;
    }
  }
 else {
    if (a < b) {
      volume=calculateHypervolumeIndicator(solutionA,null,d - 1,maximumValues,minimumValues) * (b - a) / r;
      volume+=calculateHypervolumeIndicator(solutionA,solutionB,d - 1,maximumValues,minimumValues) * (max - b) / r;
    }
 else {
      volume=calculateHypervolumeIndicator(solutionA,solutionB,d - 1,maximumValues,minimumValues) * (max - a) / r;
    }
  }
  return (volume);
}
Program: 64666
Project: 64666
Buggy source:
@Override public boolean add(Solution<?> solution){
  int flag;
  int i=0;
  Solution aux;
  while (i < solutionSet.size()) {
    aux=solutionSet.get(i);
    flag=dominanceComparator.compare(solution,aux);
    if (flag == 1) {
      return false;
    }
 else     if (flag == -1) {
      solutionSet.remove(i);
    }
 else {
      return false;
    }
    i++;
  }
  solutionSet.add(solution);
  if (solutionSet.size() > maxSize) {
    crowdingDistance.computeCrowdingDistance(solutionSet);
    int index=FindWorstSolution.find(solutionSet,crowdingDistanceComparator);
    solutionSet.remove(index);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean add(Solution<?> solution){
  int flag;
  int i=0;
  Solution aux;
  while (i < solutionSet.size()) {
    aux=solutionSet.get(i);
    flag=dominanceComparator.compare(solution,aux);
    if (flag == 1) {
      return false;
    }
 else     if (flag == -1) {
      solutionSet.remove(i);
    }
 else {
      if (equalsComparator.compare(aux,solution) == 0) {
        return false;
      }
    }
    i++;
  }
  solutionSet.add(solution);
  if (solutionSet.size() > maxSize) {
    crowdingDistance.computeCrowdingDistance(solutionSet);
    int index=FindWorstSolution.find(solutionSet,crowdingDistanceComparator);
    solutionSet.remove(index);
  }
  return true;
}
Program: 64667
Project: 64667
Buggy source:
public CrowdingDistanceArchive(int maxSize){
  this.maxSize=maxSize;
  solutionSet=new ArrayList<>(maxSize + 1);
  dominanceComparator=new DominanceComparator();
  crowdingDistanceComparator=new CrowdingDistanceComparator();
  crowdingDistance=new CrowdingDistanceImpl();
}

Fixed version (ground truth):
public CrowdingDistanceArchive(int maxSize){
  this.maxSize=maxSize;
  solutionSet=new ArrayList<>(maxSize + 1);
  dominanceComparator=new DominanceComparator();
  crowdingDistanceComparator=new CrowdingDistanceComparator();
  crowdingDistance=new CrowdingDistanceImpl();
  equalsComparator=new EqualSolutionsComparator();
}
Program: 64668
Project: 64668
Buggy source:
/** 
 * @param args Command line arguments. The first (optional) argument specifiesthe problem to solve.
 * @throws org.uma.jmetal.util.JMetalException
 * @throws java.io.IOException
 * @throws SecurityException Usage: three options - org.uma.jmetal.runner.multiobjective.SMPSORunner - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName ParetoFrontFile
 */
public static void main(String[] args) throws Exception {
  ContinuousProblem problem;
  Algorithm algorithm;
  MutationOperator mutation;
  problem=new Kursawe(3);
  Archive archive=new CrowdingDistanceArchive(100);
  mutation=new PolynomialMutation.Builder().setDistributionIndex(20.0).setProbability(1.0 / problem.getNumberOfVariables()).build();
  algorithm=new SMPSO.Builder(problem,archive).setMutation(mutation).setMaxIterations(250).setSwarmSize(100).build();
  AlgorithmRunner algorithmRunner=new AlgorithmRunner.Executor(algorithm).execute();
  List<Solution> population=algorithmRunner.getSolutionSet();
  long computingTime=algorithmRunner.getComputingTime();
  new SolutionSetOutput.Printer(population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).setFunFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).print();
  JMetalLogger.logger.info("String_Node_Str" + computingTime + "String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param args Command line arguments. The first (optional) argument specifiesthe problem to solve.
 * @throws org.uma.jmetal.util.JMetalException
 * @throws java.io.IOException
 * @throws SecurityException Usage: three options - org.uma.jmetal.runner.multiobjective.SMPSORunner - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName ParetoFrontFile
 */
public static void main(String[] args) throws Exception {
  ContinuousProblem problem;
  Algorithm algorithm;
  MutationOperator mutation;
  problem=new Fonseca();
  Archive archive=new CrowdingDistanceArchive(100);
  mutation=new PolynomialMutation.Builder().setDistributionIndex(20.0).setProbability(1.0 / problem.getNumberOfVariables()).build();
  algorithm=new SMPSO.Builder(problem,archive).setMutation(mutation).setMaxIterations(250).setSwarmSize(100).build();
  AlgorithmRunner algorithmRunner=new AlgorithmRunner.Executor(algorithm).execute();
  List<Solution> population=algorithmRunner.getSolutionSet();
  long computingTime=algorithmRunner.getComputingTime();
  new SolutionSetOutput.Printer(population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).setFunFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).print();
  JMetalLogger.logger.info("String_Node_Str" + computingTime + "String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
}
Program: 64669
Project: 64669
Buggy source:
/** 
 * Execute() method  
 */
public SolutionSet execute() throws JMetalException, ClassNotFoundException, IOException {
  initialization();
  createInitialSwarm();
  evaluateSwarm();
  initializeLeaders();
  initializeParticlesMemory();
  updateLeadersDensityEstimator();
  while (!stoppingCondition()) {
    computeSpeed(iterations,maxIterations);
    computeNewPositions();
    perturbation();
    evaluateSwarm();
    updateLeaders();
    updateParticleMemory();
    updateLeadersDensityEstimator();
    iterations++;
  }
  tearDown();
  return paretoFrontApproximation();
}

Fixed version (ground truth):
/** 
 * Execute() method  
 */
public SolutionSet execute() throws JMetalException, ClassNotFoundException, IOException {
  initialization();
  createInitialSwarm();
  evaluateSwarm();
  initializeLeaders();
  initializeParticlesMemory();
  updateLeadersDensityEstimator();
  while (!stoppingCondition()) {
    computeSpeed(iterations,maxIterations);
    computeNewPositions();
    evaluateSwarm();
    updateLeaders();
    updateParticleMemory();
    updateLeadersDensityEstimator();
    iterations++;
  }
  tearDown();
  return paretoFrontApproximation();
}
Program: 64670
Project: 64670
Buggy source:
protected void computeNewPositions(){
  for (int i=0; i < swarmSize; i++) {
    XReal particle=new XReal(swarm.get(i));
    for (int var=0; var < particle.getNumberOfDecisionVariables(); var++) {
      particle.setValue(var,particle.getValue(var) + speed[i][var]);
      if (particle.getValue(var) < problem.getLowerLimit(var)) {
        particle.setValue(var,problem.getLowerLimit(var));
        speed[i][var]=speed[i][var] * changeVelocity1;
      }
      if (particle.getValue(var) > problem.getUpperLimit(var)) {
        particle.setValue(var,problem.getUpperLimit(var));
        speed[i][var]=speed[i][var] * changeVelocity2;
      }
    }
  }
}

Fixed version (ground truth):
protected void computeNewPositions(){
  for (int i=0; i < swarmSize; i++) {
    XReal particle=new XReal(swarm.get(i));
    for (int j=0; j < particle.getNumberOfDecisionVariables(); j++) {
      double v=particle.getValue(j);
      particle.setValue(j,particle.getValue(j) + speed[i][j]);
      if (particle.getValue(j) < problem.getLowerLimit(j)) {
        particle.setValue(j,problem.getLowerLimit(j));
        speed[i][j]=speed[i][j] * changeVelocity1;
      }
      if (particle.getValue(j) > problem.getUpperLimit(j)) {
        particle.setValue(j,problem.getUpperLimit(j));
        speed[i][j]=speed[i][j] * changeVelocity2;
      }
    }
  }
}
Program: 64671
Project: 64671
Buggy source:
@Deprecated public SMPSO(){
  super();
  r1Max=1.0;
  r1Min=0.0;
  r2Max=1.0;
  r2Min=0.0;
  c1Max=2.5;
  c1Min=1.5;
  c2Max=2.5;
  c2Min=1.5;
  weightMax=0.1;
  weightMin=0.1;
  changeVelocity1=-1;
  changeVelocity2=-1;
}

Fixed version (ground truth):
/** 
 * Constructor 
 */
public SMPSO(Builder builder){
  problem=builder.problem;
  swarmSize=builder.swarmSize;
  leaders=builder.leaders;
  mutation=builder.mutationOperator;
  maxIterations=builder.maxIterations;
  r1Max=builder.r1Max;
  r1Min=builder.r1Min;
  r2Max=builder.r2Max;
  r2Min=builder.r2Min;
  c1Max=builder.c1Max;
  c1Min=builder.c1Min;
  c2Max=builder.c2Max;
  c2Min=builder.c2Min;
  weightMax=builder.weightMax;
  weightMin=builder.weightMin;
  changeVelocity1=builder.changeVelocity1;
  changeVelocity2=builder.changeVelocity2;
}
Program: 64672
Project: 64672
Buggy source:
protected void computeNewPositions(){
  for (int i=0; i < swarmSize; i++) {
    DoubleSolution particle=(DoubleSolution)swarm.get(i).copy();
    for (int var=0; var < particle.getNumberOfVariables(); var++) {
      particle.setVariableValue(var,particle.getVariableValue(var) + speed[i][var]);
      if (particle.getVariableValue(var) < problem.getLowerBound(var)) {
        particle.setVariableValue(var,problem.getLowerBound(var));
        speed[i][var]=speed[i][var] * changeVelocity1;
      }
      if (particle.getVariableValue(var) > problem.getUpperBound(var)) {
        particle.setVariableValue(var,problem.getUpperBound(var));
        speed[i][var]=speed[i][var] * changeVelocity2;
      }
    }
  }
}

Fixed version (ground truth):
protected void computeNewPositions(){
  for (int i=0; i < swarmSize; i++) {
    DoubleSolution particle=swarm.get(i);
    for (int j=0; j < particle.getNumberOfVariables(); j++) {
      double v=particle.getVariableValue(j);
      particle.setVariableValue(j,particle.getVariableValue(j) + speed[i][j]);
      if (particle.getVariableValue(j) < problem.getLowerBound(j)) {
        particle.setVariableValue(j,problem.getLowerBound(j));
        speed[i][j]=speed[i][j] * changeVelocity1;
      }
      if (particle.getVariableValue(j) > problem.getUpperBound(j)) {
        particle.setVariableValue(j,problem.getUpperBound(j));
        speed[i][j]=speed[i][j] * changeVelocity2;
      }
    }
  }
}
Program: 64673
Project: 64673
Buggy source:
/** 
 * @param args Command line arguments. The first (optional) argument specifiesthe problem to solve.
 * @throws org.uma.jmetal.util.JMetalException
 * @throws java.io.IOException
 * @throws SecurityException Usage: three options - org.uma.jmetal.runner.multiobjective.SMPSORunner - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName ParetoFrontFile
 */
public static void main(String[] args) throws Exception {
  ContinuousProblem problem;
  Algorithm algorithm;
  MutationOperator mutation;
  problem=new Fonseca();
  Archive archive=new CrowdingDistanceArchive(100);
  mutation=new PolynomialMutation.Builder().setDistributionIndex(20.0).setProbability(1.0 / problem.getNumberOfVariables()).build();
  algorithm=new SMPSO.Builder(problem,archive).setMutation(mutation).setMaxIterations(250).setSwarmSize(100).build();
  AlgorithmRunner algorithmRunner=new AlgorithmRunner.Executor(algorithm).execute();
  List<Solution> population=algorithmRunner.getSolutionSet();
  long computingTime=algorithmRunner.getComputingTime();
  new SolutionSetOutput.Printer(population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).setFunFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).print();
  JMetalLogger.logger.info("String_Node_Str" + computingTime + "String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param args Command line arguments. The first (optional) argument specifiesthe problem to solve.
 * @throws org.uma.jmetal.util.JMetalException
 * @throws java.io.IOException
 * @throws SecurityException Usage: three options - org.uma.jmetal.runner.multiobjective.SMPSORunner - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName - org.uma.jmetal.runner.multiobjective.SMPSORunner problemName ParetoFrontFile
 */
public static void main(String[] args) throws Exception {
  ContinuousProblem problem;
  Algorithm algorithm;
  MutationOperator mutation;
  problem=new Kursawe();
  Archive archive=new CrowdingDistanceArchive(100);
  mutation=new PolynomialMutation.Builder().setDistributionIndex(20.0).setProbability(1.0 / problem.getNumberOfVariables()).build();
  algorithm=new SMPSO.Builder(problem,archive).setMutation(mutation).setMaxIterations(250).setSwarmSize(100).build();
  AlgorithmRunner algorithmRunner=new AlgorithmRunner.Executor(algorithm).execute();
  List<Solution> population=algorithmRunner.getSolutionSet();
  long computingTime=algorithmRunner.getComputingTime();
  new SolutionSetOutput.Printer(population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).setFunFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).print();
  JMetalLogger.logger.info("String_Node_Str" + computingTime + "String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
  JMetalLogger.logger.info("String_Node_Str");
}
Program: 64674
Project: 64674
Buggy source:
/** 
 * Compares two solutions.
 * @param object1 Object representing the first <code>Solution</code>.
 * @param object2 Object representing the second <code>Solution</code>.
 * @return -1, or 0, or 1, or 2 if solution1 is dominates solution2, solution1and solution2 are equals, or solution1 is greater than solution2, respectively.
 */
@Override public int compare(Solution object1,Solution object2){
  if (object1 == null) {
    return 1;
  }
 else   if (object2 == null) {
    return -1;
  }
  int dominate1;
  int dominate2;
  dominate1=0;
  dominate2=0;
  Solution solution1=(Solution)object1;
  Solution solution2=(Solution)object2;
  int flag;
  double value1, value2;
  for (int i=0; i < solution1.getNumberOfObjectives(); i++) {
    flag=(new ObjectiveComparator(i)).compare(solution1,solution2);
    value1=solution1.getObjective(i);
    value2=solution2.getObjective(i);
    if (value1 < value2) {
      flag=-1;
    }
 else     if (value1 > value2) {
      flag=1;
    }
 else {
      flag=0;
    }
    if (flag == -1) {
      dominate1=1;
    }
    if (flag == 1) {
      dominate2=1;
    }
  }
  if (dominate1 == 0 && dominate2 == 0) {
    return 0;
  }
  if (dominate1 == 1) {
    return -1;
  }
 else   if (dominate2 == 1) {
    return 1;
  }
  return 2;
}

Fixed version (ground truth):
/** 
 * Compares two solutions.
 * @param object1 Object representing the first <code>Solution</code>.
 * @param object2 Object representing the second <code>Solution</code>.
 * @return -1, or 0, or 1, or 2 if solution1 is dominates solution2, solution1and solution2 are equals, or solution1 is greater than solution2, respectively.
 */
@Override public int compare(Solution object1,Solution object2){
  if (object1 == null) {
    return 1;
  }
 else   if (object2 == null) {
    return -1;
  }
  int dominate1;
  int dominate2;
  dominate1=0;
  dominate2=0;
  Solution solution1=(Solution)object1;
  Solution solution2=(Solution)object2;
  int flag;
  double value1, value2;
  for (int i=0; i < solution1.getNumberOfObjectives(); i++) {
    value1=solution1.getObjective(i);
    value2=solution2.getObjective(i);
    if (value1 < value2) {
      flag=-1;
    }
 else     if (value1 > value2) {
      flag=1;
    }
 else {
      flag=0;
    }
    if (flag == -1) {
      dominate1=1;
    }
    if (flag == 1) {
      dominate2=1;
    }
  }
  if (dominate1 == 0 && dominate2 == 0) {
    return 0;
  }
  if (dominate1 == 1) {
    return -1;
  }
 else   if (dominate2 == 1) {
    return 1;
  }
  return 2;
}
Program: 64676
Project: 64676
Buggy source:
public void setRank(int ranking){
  this.ranking=ranking;
}

Fixed version (ground truth):
@Override public void setRank(int ranking){
  this.ranking=ranking;
}