nus-yam/ex-repair huggingface dataset:
Program: 64473
Project: 64473
Buggy source:
/** 
 * Create a list of non dominated   {@link DoubleSolution} solutions from the FUNx.tsv and VARx.tsv files thatmust have been previously obtained (probably by invoking the  {@link ExecuteAlgorithms#run} method).
 * @param problem
 * @return
 * @throws FileNotFoundException
 */
private List<DoubleSolution> getNonDominatedSolutions(Problem<?> problem) throws FileNotFoundException {
  NonDominatedSolutionListArchive<DoubleSolution> nonDominatedSolutionArchive=new NonDominatedSolutionListArchive<DoubleSolution>();
  for (  ExperimentAlgorithm<?,?> algorithm : experiment.getAlgorithmList()) {
    String problemDirectory=experiment.getExperimentBaseDirectory() + "String_Node_Str" + algorithm.getAlgorithmTag()+ "String_Node_Str"+ problem.getName();
    for (int i=0; i < experiment.getIndependentRuns(); i++) {
      String frontFileName=problemDirectory + "String_Node_Str" + experiment.getOutputParetoFrontFileName()+ i+ "String_Node_Str";
      String paretoSetFileName=problemDirectory + "String_Node_Str" + experiment.getOutputParetoSetFileName()+ i+ "String_Node_Str";
      Front frontWithObjectiveValues=new ArrayFront(frontFileName);
      Front frontWithVariableValues=new ArrayFront(paretoSetFileName);
      List<DoubleSolution> solutionList=createSolutionListFrontFiles(algorithm.getAlgorithmTag(),frontWithVariableValues,frontWithObjectiveValues);
      for (      DoubleSolution solution : solutionList) {
        nonDominatedSolutionArchive.add(solution);
      }
    }
  }
  return nonDominatedSolutionArchive.getSolutionList();
}

Fixed version (ground truth):
/** 
 * Create a list of non dominated   {@link DoubleSolution} solutions from the FUNx.tsv and VARx.tsv files thatmust have been previously obtained (probably by invoking the  {@link ExecuteAlgorithms#run} method).
 * @param problem
 * @return
 * @throws FileNotFoundException
 */
private List<DoubleSolution> getNonDominatedSolutions(ExperimentProblem<?> problem) throws FileNotFoundException {
  NonDominatedSolutionListArchive<DoubleSolution> nonDominatedSolutionArchive=new NonDominatedSolutionListArchive<DoubleSolution>();
  for (  ExperimentAlgorithm<?,?> algorithm : experiment.getAlgorithmList()) {
    String problemDirectory=experiment.getExperimentBaseDirectory() + "String_Node_Str" + algorithm.getAlgorithmTag()+ "String_Node_Str"+ problem.getTag();
    for (int i=0; i < experiment.getIndependentRuns(); i++) {
      String frontFileName=problemDirectory + "String_Node_Str" + experiment.getOutputParetoFrontFileName()+ i+ "String_Node_Str";
      String paretoSetFileName=problemDirectory + "String_Node_Str" + experiment.getOutputParetoSetFileName()+ i+ "String_Node_Str";
      Front frontWithObjectiveValues=new ArrayFront(frontFileName);
      Front frontWithVariableValues=new ArrayFront(paretoSetFileName);
      List<DoubleSolution> solutionList=createSolutionListFrontFiles(algorithm.getAlgorithmTag(),frontWithVariableValues,frontWithObjectiveValues);
      for (      DoubleSolution solution : solutionList) {
        nonDominatedSolutionArchive.add(solution);
      }
    }
  }
  return nonDominatedSolutionArchive.getSolutionList();
}
Program: 64474
Project: 64474
Buggy source:
private void writeReferenceFrontFile(String outputDirectoryName,Problem<?> problem,List<DoubleSolution> nonDominatedSolutions) throws IOException {
  String referenceFrontFileName=outputDirectoryName + "String_Node_Str" + problem.getName()+ "String_Node_Str";
  new SolutionListOutput(nonDominatedSolutions).printObjectivesToFile(referenceFrontFileName);
}

Fixed version (ground truth):
private void writeReferenceFrontFile(String outputDirectoryName,ExperimentProblem<?> problem,List<DoubleSolution> nonDominatedSolutions) throws IOException {
  String referenceFrontFileName=outputDirectoryName + "String_Node_Str" + problem.getTag()+ "String_Node_Str";
  new SolutionListOutput(nonDominatedSolutions).printObjectivesToFile(referenceFrontFileName);
}
Program: 64475
Project: 64475
Buggy source:
@Override protected void updateProgress(){
  evaluations.increment(getMaxPopulationSize());
  solutionListMeasure.push(getPopulation());
  hypervolumeValue.push(new PISAHypervolume<S>(referenceFront).evaluate(getNonDominatedSolutions(getPopulation())));
}

Fixed version (ground truth):
@Override protected void updateProgress(){
  evaluations.increment(getMaxPopulationSize());
  solutionListMeasure.push(getPopulation());
  if (referenceFront.getNumberOfPoints() > 0) {
    hypervolumeValue.push(new PISAHypervolume<S>(referenceFront).evaluate(getNonDominatedSolutions(getPopulation())));
  }
}
Program: 64476
Project: 64476
Buggy source:
public double computeHypervolume(List<S> solutionList,Point referencePoint){
  double hv=0.0;
  if (solutionList.size() == 0) {
    hv=0.0;
  }
 else {
    numberOfObjectives=solutionList.get(0).getNumberOfObjectives();
    this.referencePoint=referencePoint;
    if (numberOfObjectives == 2) {
      Collections.sort(solutionList,new ObjectiveComparator<S>(0,ObjectiveComparator.Ordering.DESCENDING));
      hv=get2DHV(solutionList);
    }
 else {
      WfgHypervolumeVersion wfgHv=new WfgHypervolumeVersion(numberOfObjectives,solutionList.size());
      hv=wfgHv.getHV(new WfgHypervolumeFront(solutionList));
    }
  }
  return hv;
}

Fixed version (ground truth):
public double computeHypervolume(List<S> solutionList,Point referencePoint){
  double hv=0.0;
  if (solutionList.size() == 0) {
    hv=0.0;
  }
 else {
    numberOfObjectives=solutionList.get(0).getNumberOfObjectives();
    this.referencePoint=referencePoint;
    if (numberOfObjectives == 2) {
      Collections.sort(solutionList,new ObjectiveComparator<S>(1,ObjectiveComparator.Ordering.DESCENDING));
      hv=get2DHV(solutionList);
    }
 else {
      WfgHypervolumeVersion wfgHv=new WfgHypervolumeVersion(numberOfObjectives,solutionList.size());
      hv=wfgHv.getHV(new WfgHypervolumeFront(solutionList));
    }
  }
  return hv;
}
Program: 64477
Project: 64477
Buggy source:
/** 
 * Computes the HV of a solution list. REQUIRES: The problem is bi-objective REQUIRES: The setArchive is ordered in descending order by the second objective
 * @return
 */
public double get2DHV(List<? extends Solution<?>> solutionSet){
  double hv=0.0;
  if (solutionSet.size() > 0) {
    hv=Math.abs((solutionSet.get(0).getObjective(0) - referencePoint.getDimensionValue(0)) * (solutionSet.get(0).getObjective(1) - referencePoint.getDimensionValue(1)));
    for (int i=1; i < solutionSet.size(); i++) {
      double tmp=Math.abs((solutionSet.get(i).getObjective(0) - referencePoint.getDimensionValue(0)) * (solutionSet.get(i).getObjective(1) - solutionSet.get(i - 1).getObjective(1)));
      hv+=tmp;
    }
  }
  return hv;
}

Fixed version (ground truth):
/** 
 * Computes the HV of a solution list. REQUIRES: The problem is bi-objective REQUIRES: The setArchive is ordered in descending order by the second objective
 * @return
 */
public double get2DHV(List<? extends Solution<?>> solutionSet){
  double hv=0.0;
  if (solutionSet.size() > 0) {
    hv=Math.abs((solutionSet.get(0).getObjective(0) - referencePoint.getDimensionValue(0)) * (solutionSet.get(0).getObjective(1) - referencePoint.getDimensionValue(1)));
    for (int i=1; i < solutionSet.size(); i++) {
      double tmp;
      tmp=Math.abs((solutionSet.get(i).getObjective(0) - referencePoint.getDimensionValue(0)) * (solutionSet.get(i).getObjective(1) - solutionSet.get(i - 1).getObjective(1)));
      hv+=tmp;
    }
  }
  return hv;
}
Program: 64478
Project: 64478
Buggy source:
/** 
 * CASE 1: solution set -> front obtained from the ZDT1.rf file. Reference front: [0,1], [1,0]
 * @throws FileNotFoundException
 */
@Test public void shouldEvaluateWorkProperlyCase1() throws FileNotFoundException {
  Front referenceFront=new ArrayFront(2,2);
  referenceFront.setPoint(0,new ArrayPoint(new double[]{1.0,0.0}));
  referenceFront.setPoint(0,new ArrayPoint(new double[]{0.0,1.0}));
  Front storeFront=new ArrayFront("String_Node_Str");
  DoubleProblem problem=new MockDoubleProblem(2);
  List<DoubleSolution> frontToEvaluate=new ArrayList<>();
  for (int i=0; i < storeFront.getNumberOfPoints(); i++) {
    DoubleSolution solution=problem.createSolution();
    solution.setObjective(0,storeFront.getPoint(i).getDimensionValue(0));
    solution.setObjective(1,storeFront.getPoint(i).getDimensionValue(1));
    frontToEvaluate.add(solution);
  }
  WFGHypervolume<DoubleSolution> hypervolume=new WFGHypervolume<>();
  double result=hypervolume.computeHypervolume(frontToEvaluate,new ArrayPoint(new double[]{0.0,1.0}));
  System.out.println("String_Node_Str" + result);
  assertEquals(0.6661,result,0.0001);
}

Fixed version (ground truth):
/** 
 * CASE 1: solution set -> front composed of the points [0.25, 0.75] and [0.75, 0.25]. Reference point: [0,0]
 */
@Test public void shouldEvaluateWorkProperlyCase1() throws FileNotFoundException {
  DoubleProblem problem=new MockDoubleProblem(2);
  List<DoubleSolution> frontToEvaluate=new ArrayList<>();
  DoubleSolution solution=problem.createSolution();
  solution.setObjective(0,0.25);
  solution.setObjective(1,0.75);
  frontToEvaluate.add(solution);
  solution=problem.createSolution();
  solution.setObjective(0,0.75);
  solution.setObjective(1,0.25);
  frontToEvaluate.add(solution);
  WFGHypervolume<DoubleSolution> hypervolume=new WFGHypervolume<>();
  double result=hypervolume.computeHypervolume(frontToEvaluate,new ArrayPoint(new double[]{1.0,1.0}));
  System.out.println("String_Node_Str" + result);
  assertEquals(0.25 * 0.75 + 0.25 * 0.5,result,0.0001);
}
Program: 64479
Project: 64479
Buggy source:
public GWASFGA(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);
}

Fixed version (ground truth):
public GWASFGA(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);
  WeightVector weightVector=new WeightVector();
  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: 64480
Project: 64480
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);
  setMaxPopulationSize(populationSize);
  this.interestPoint=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){
  this(problem,populationSize,maxIterations,crossoverOperator,mutationOperator,selectionOperator,evaluator,referencePoint,"String_Node_Str");
}
Program: 64481
Project: 64481
Buggy source:
protected Ranking<S> computeRanking(List<S> solutionList){
  Ranking<S> ranking=new WASFGARanking<>(this.achievementScalarizingFunction);
  ranking.computeRanking(solutionList);
  return ranking;
}

Fixed version (ground truth):
protected Ranking<S> computeRanking(List<S> solutionList){
  Ranking<S> ranking=new WASFGARankingConstraint<>(this.achievementScalarizingFunction);
  ranking.computeRanking(solutionList);
  return ranking;
}
Program: 64482
Project: 64482
Buggy source:
public AbstractUtilityFunctionsSet<S> createUtilityFunction(){
  double[][] weights=WeightVector.initUniformWeights2D(0.005,getMaxPopulationSize());
  weights=WeightVector.invertWeights(weights,true);
  ASFWASFGA<S> aux=new ASFWASFGA<>(weights,interestPoint);
  return aux;
}

Fixed version (ground truth):
public AbstractUtilityFunctionsSet<S> createUtilityFunction(){
  WeightVector weightVector=new WeightVector();
  double[][] weights;
  if ("String_Node_Str".equals(this.weightVectorsFileName)) {
    weights=weightVector.initUniformWeights2D(0.005,getMaxPopulationSize());
  }
 else {
    weights=weightVector.getWeightsFromFile(this.weightVectorsFileName);
  }
  weights=WeightVector.invertWeights(weights,true);
  if (weights.length != maxPopulationSize) {
    throw new JMetalException("String_Node_Str" + weights.length + "String_Node_Str"+ maxPopulationSize+ "String_Node_Str");
  }
  ASFWASFGA<S> aux=new ASFWASFGA<>(weights,interestPoint);
  return aux;
}
Program: 64483
Project: 64483
Buggy source:
/** 
 * Returns the euclidean distance between a pair of solutions in the objective space
 * @param firstSolution
 * @param secondSolution
 * @return
 */
static <S extends Solution<?>>double distanceBetweenObjectives(S firstSolution,S secondSolution){
  double diff;
  double distance=0.0;
  for (int nObj=0; nObj < firstSolution.getNumberOfObjectives(); nObj++) {
    diff=firstSolution.getObjective(nObj) - secondSolution.getObjective(nObj);
    distance+=Math.pow(diff,2.0);
  }
  return Math.sqrt(distance);
}

Fixed version (ground truth):
/** 
 * Returns the euclidean distance between a pair of solutions in the objective space
 */
public static <S extends Solution<?>>double distanceBetweenObjectives(S firstSolution,S secondSolution){
  double diff;
  double distance=0.0;
  for (int nObj=0; nObj < firstSolution.getNumberOfObjectives(); nObj++) {
    diff=firstSolution.getObjective(nObj) - secondSolution.getObjective(nObj);
    distance+=Math.pow(diff,2.0);
  }
  return Math.sqrt(distance);
}
Program: 64484
Project: 64484
Buggy source:
/** 
 * Return the best solution between those passed as arguments. If they are equal or incomparable one of them is chosen based on the given policy.
 * @param solution1
 * @param solution2
 * @param equalityPolicy
 * @return The best solution
 */
public static <S extends Solution<?>>S getBestSolution(S solution1,S solution2,Comparator<S> comparator,BinaryOperator<S> equalityPolicy){
  S result;
  int flag=comparator.compare(solution1,solution2);
  if (flag == -1) {
    result=solution1;
  }
 else   if (flag == 1) {
    result=solution2;
  }
 else {
    result=equalityPolicy.apply(solution1,solution2);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Return the best solution between those passed as arguments. If they are equal or incomparable one of them is chosen based on the given policy.
 * @return The best solution
 */
public static <S extends Solution<?>>S getBestSolution(S solution1,S solution2,Comparator<S> comparator,BinaryOperator<S> equalityPolicy){
  S result;
  int flag=comparator.compare(solution1,solution2);
  if (flag == -1) {
    result=solution1;
  }
 else   if (flag == 1) {
    result=solution2;
  }
 else {
    result=equalityPolicy.apply(solution1,solution2);
  }
  return result;
}
Program: 64485
Project: 64485
Buggy source:
/** 
 * Returns the minimum distance from a <code>Solution</code> to a <code>SolutionSet according to the encodings.variable values</code>.
 * @param solution The <code>Solution</code>.
 * @param solutionList The <code>List<Solution></></code>.
 * @return The minimum distance between solution and the set.
 */
public static double distanceToSolutionListInSolutionSpace(DoubleSolution solution,List<DoubleSolution> solutionList){
  double distance=Double.MAX_VALUE;
  for (int i=0; i < solutionList.size(); i++) {
    double aux=distanceBetweenSolutions(solution,solutionList.get(i));
    if (aux < distance)     distance=aux;
  }
  return distance;
}

Fixed version (ground truth):
/** 
 * Returns the minimum distance from a <code>Solution</code> to a <code>SolutionSet according to the encodings.variable values</code>.
 * @param solution     The <code>Solution</code>.
 * @param solutionList The <code>List<Solution></></code>.
 * @return The minimum distance between solution and the set.
 */
public static double distanceToSolutionListInSolutionSpace(DoubleSolution solution,List<DoubleSolution> solutionList){
  double distance=Double.MAX_VALUE;
  for (int i=0; i < solutionList.size(); i++) {
    double aux=distanceBetweenSolutions(solution,solutionList.get(i));
    if (aux < distance)     distance=aux;
  }
  return distance;
}
Program: 64486
Project: 64486
Buggy source:
public RNSGAIIRanking(PreferenceNSGAII<S> utilityFunctions,double epsilon,List<Double> interestPoint){
  this.utilityFunctions=utilityFunctions;
  this.epsilon=epsilon;
  referencePoint=interestPoint;
}

Fixed version (ground truth):
public RNSGAIIRanking(PreferenceNSGAII<S> utilityFunctions,double epsilon,List<Double> interestPoint){
  this.utilityFunctions=utilityFunctions;
  this.epsilon=epsilon;
  referencePoint=interestPoint;
  this.numberOfViolatedConstraints=new NumberOfViolatedConstraints<S>();
}
Program: 64487
Project: 64487
Buggy source:
private void removeRank(S solution){
  boolean enc=false;
  int i=0;
  while (i < this.rankedSubpopulations.size()) {
    enc=this.rankedSubpopulations.get(i).contains(solution);
    if (enc) {
      this.rankedSubpopulations.get(i).remove(solution);
    }
    i++;
  }
}

Fixed version (ground truth):
private void removeRank(S solution){
  boolean enc=false;
  int i=0;
  while (i < this.rankedSubpopulations.size()) {
    while (this.rankedSubpopulations.get(i).contains(solution)) {
      this.rankedSubpopulations.get(i).remove(solution);
    }
    i++;
  }
}
Program: 64490
Project: 64490
Buggy source:
protected List<S> crowdingDistanceSelection(Ranking<S> ranking){
  CrowdingDistance<S> crowdingDistance=new CrowdingDistance<S>();
  List<S> 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<S> crowdingDistanceSelection(Ranking<S> ranking){
  CrowdingDistance<S> crowdingDistance=new CrowdingDistance<S>();
  List<S> population=new ArrayList<>(solutionsToSelect);
  int rankingIndex=0;
  while (population.size() < solutionsToSelect) {
    if (subfrontFillsIntoThePopulation(ranking,rankingIndex,population)) {
      crowdingDistance.computeDensityEstimator(ranking.getSubfront(rankingIndex));
      addRankedSolutionsToPopulation(ranking,rankingIndex,population);
      rankingIndex++;
    }
 else {
      crowdingDistance.computeDensityEstimator(ranking.getSubfront(rankingIndex));
      addLastRankedSolutionsToPopulation(ranking,rankingIndex,population);
    }
  }
  return population;
}
Program: 64492
Project: 64492
Buggy source:
private void writeFilesWithTheSolutionsContributedByEachAlgorithm(String outputDirectoryName,Problem<?> problem,List<PointSolution> nonDominatedSolutions) throws IOException {
  GenericSolutionAttribute<PointSolution,String> solutionAttribute=new GenericSolutionAttribute<PointSolution,String>();
  for (  ExperimentAlgorithm<?,?> algorithm : experiment.getAlgorithmList()) {
    List<PointSolution> solutionsPerAlgorithm=new ArrayList<>();
    for (    PointSolution solution : nonDominatedSolutions) {
      if (algorithm.getAlgorithmTag().equals(solutionAttribute.getAttribute(solution))) {
        solutionsPerAlgorithm.add(solution);
      }
    }
    new SolutionListOutput(solutionsPerAlgorithm).printObjectivesToFile(outputDirectoryName + "String_Node_Str" + problem.getName()+ "String_Node_Str"+ algorithm.getAlgorithmTag()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void writeFilesWithTheSolutionsContributedByEachAlgorithm(String outputDirectoryName,ExperimentProblem<?> problem,List<PointSolution> nonDominatedSolutions) throws IOException {
  GenericSolutionAttribute<PointSolution,String> solutionAttribute=new GenericSolutionAttribute<PointSolution,String>();
  for (  ExperimentAlgorithm<?,?> algorithm : experiment.getAlgorithmList()) {
    List<PointSolution> solutionsPerAlgorithm=new ArrayList<>();
    for (    PointSolution solution : nonDominatedSolutions) {
      if (algorithm.getAlgorithmTag().equals(solutionAttribute.getAttribute(solution))) {
        solutionsPerAlgorithm.add(solution);
      }
    }
    new SolutionListOutput(solutionsPerAlgorithm).printObjectivesToFile(outputDirectoryName + "String_Node_Str" + problem.getTag()+ "String_Node_Str"+ algorithm.getAlgorithmTag()+ "String_Node_Str");
  }
}
Program: 64493
Project: 64493
Buggy source:
/** 
 * Evaluate() method 
 */
@Override public void evaluate(DoubleSolution solution){
  double[] fx=new double[2];
  double[] x=new double[solution.getNumberOfVariables()];
  for (int i=0; i < solution.getNumberOfVariables(); i++) {
    x[i]=solution.getVariableValue(i);
  }
  fx[0]=106780.37 * (x[1] + x[2]) + 61704.67;
  fx[1]=3000 * x[0];
  fx[2]=305700 * 2289 * x[1] / Math.pow(0.06 * 2289,0.65);
  fx[3]=250 * 2289 * Math.exp(-39.75 * x[1] + 9.9 * x[2] + 2.74);
  fx[4]=25 * (1.39 / (x[0] * x[1]) + 4940 * x[2] - 80);
  solution.setObjective(0,fx[0]);
  solution.setObjective(1,fx[1]);
  solution.setObjective(2,fx[2]);
  solution.setObjective(3,fx[3]);
  solution.setObjective(4,fx[4]);
}

Fixed version (ground truth):
/** 
 * Evaluate() method 
 */
@Override public void evaluate(DoubleSolution solution){
  double[] fx=new double[solution.getNumberOfObjectives()];
  double[] x=new double[solution.getNumberOfVariables()];
  for (int i=0; i < solution.getNumberOfVariables(); i++) {
    x[i]=solution.getVariableValue(i);
  }
  fx[0]=106780.37 * (x[1] + x[2]) + 61704.67;
  fx[1]=3000 * x[0];
  fx[2]=305700 * 2289 * x[1] / Math.pow(0.06 * 2289,0.65);
  fx[3]=250 * 2289 * Math.exp(-39.75 * x[1] + 9.9 * x[2] + 2.74);
  fx[4]=25 * (1.39 / (x[0] * x[1]) + 4940 * x[2] - 80);
  solution.setObjective(0,fx[0]);
  solution.setObjective(1,fx[1]);
  solution.setObjective(2,fx[2]);
  solution.setObjective(3,fx[3]);
  solution.setObjective(4,fx[4]);
}
Program: 64494
Project: 64494
Buggy source:
@Override protected Ranking<S> computeRanking(List<S> solutionList){
  Ranking<S> ranking=new RNSGAIIRanking<S>(achievementScalarizingFunction,epsilon,interestPoint);
  ranking.computeRanking(solutionList);
  return ranking;
}

Fixed version (ground truth):
protected Ranking<S> computeRanking(List<S> solutionList){
  Ranking<S> ranking=new RNSGAIIRanking<S>(achievementScalarizingFunction,epsilon,interestPoint);
  ranking.computeRanking(solutionList);
  return ranking;
}
Program: 64495
Project: 64495
Buggy source:
public PreferenceNSGAII<S> createUtilityFunction(){
  List<Double> weights=new ArrayList<>();
  for (int i=0; i < getProblem().getNumberOfObjectives(); i++) {
    weights.add(1.0d / getProblem().getNumberOfObjectives());
  }
  PreferenceNSGAII<S> aux=new PreferenceNSGAII<S>(weights,this.interestPoint);
  return aux;
}

Fixed version (ground truth):
public PreferenceNSGAII<S> createUtilityFunction(){
  List<Double> weights=new ArrayList<>();
  for (int i=0; i < getProblem().getNumberOfObjectives(); i++) {
    weights.add(1.0d / getProblem().getNumberOfObjectives());
  }
  PreferenceNSGAII<S> aux=new PreferenceNSGAII<S>(weights);
  return aux;
}
Program: 64496
Project: 64496
Buggy source:
public void updateReferencePoint(List<Double> pointList){
  this.achievementScalarizingFunction.updatePointOfInterest(pointList);
}

Fixed version (ground truth):
public void updateReferencePoint(List<Double> newReferencePoints){
  this.interestPoint=newReferencePoints;
}
Program: 64497
Project: 64497
Buggy source:
@Override protected Ranking<S> computeRanking(List<S> solutionList){
  Ranking<S> ranking=new RNSGAIIRanking<S>(achievementScalarizingFunction,epsilon);
  ranking.computeRanking(solutionList);
  return ranking;
}

Fixed version (ground truth):
@Override protected Ranking<S> computeRanking(List<S> solutionList){
  Ranking<S> ranking=new RNSGAIIRanking<S>(achievementScalarizingFunction,epsilon,interestPoint);
  ranking.computeRanking(solutionList);
  return ranking;
}
Program: 64498
Project: 64498
Buggy source:
/** 
 * NSGAIIBuilder constructor
 */
public RNSGAIIBuilder(Problem<S> problem,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,List<Double> referencePoint){
  this.problem=problem;
  maxEvaluations=25000;
  populationSize=100;
  this.crossoverOperator=crossoverOperator;
  this.mutationOperator=mutationOperator;
  selectionOperator=new BinaryTournamentSelection<S>(new RankingAndCrowdingDistanceComparator<S>());
  evaluator=new SequentialSolutionListEvaluator<S>();
  this.referencePoint=referencePoint;
}

Fixed version (ground truth):
/** 
 * NSGAIIBuilder constructor
 */
public RNSGAIIBuilder(Problem<S> problem,CrossoverOperator<S> crossoverOperator,MutationOperator<S> mutationOperator,List<Double> referencePoint,double epsilon){
  this.problem=problem;
  maxEvaluations=25000;
  populationSize=100;
  this.crossoverOperator=crossoverOperator;
  this.mutationOperator=mutationOperator;
  selectionOperator=new BinaryTournamentSelection<S>(new RankingAndCrowdingDistanceComparator<S>());
  evaluator=new SequentialSolutionListEvaluator<S>();
  this.referencePoint=referencePoint;
  this.epsilon=epsilon;
}
Program: 64499
Project: 64499
Buggy source:
public RNSGAII<S> build(){
  RNSGAII<S> algorithm=new RNSGAII<S>(problem,maxEvaluations,populationSize,crossoverOperator,mutationOperator,selectionOperator,evaluator,referencePoint,0.001);
  return algorithm;
}

Fixed version (ground truth):
public RNSGAII<S> build(){
  RNSGAII<S> algorithm=new RNSGAII<S>(problem,maxEvaluations,populationSize,crossoverOperator,mutationOperator,selectionOperator,evaluator,referencePoint,epsilon);
  return algorithm;
}
Program: 64500
Project: 64500
Buggy source:
public Double evaluate(S solution){
  List<Double> objectiveValues=new ArrayList(solution.getNumberOfObjectives());
  for (int i=0; i < solution.getNumberOfObjectives(); ++i) {
    objectiveValues.add(solution.getObjective(i));
  }
  double totalDistance=0.0D;
  double normalizeDiff=0.0D;
  int numberOfPoint=this.interestPoint.size() / solution.getNumberOfObjectives();
  int index=0;
  for (int j=0; j < numberOfPoint; j++) {
    double distance=0.0D;
    for (int i=0; i < solution.getNumberOfObjectives(); i++) {
      if (this.upperBounds != null && this.lowerBounds != null) {
        normalizeDiff=(solution.getObjective(i) - this.interestPoint.get(index)) / (this.upperBounds.get(i) - this.lowerBounds.get(i));
      }
 else {
        normalizeDiff=solution.getObjective(i) - this.interestPoint.get(index);
      }
      distance+=weights.get(i) * Math.pow(normalizeDiff,2.0D);
      index++;
    }
    totalDistance+=Math.sqrt(distance);
  }
  return totalDistance;
}

Fixed version (ground truth):
public Double evaluate(S solution){
  List<Double> objectiveValues=new ArrayList(solution.getNumberOfObjectives());
  for (int i=0; i < solution.getNumberOfObjectives(); ++i) {
    objectiveValues.add(solution.getObjective(i));
  }
  double normalizeDiff=0.0D;
  double distance=0.0D;
  for (int i=0; i < solution.getNumberOfObjectives(); i++) {
    if (this.upperBounds != null && this.lowerBounds != null) {
      normalizeDiff=(solution.getObjective(i) - this.interestPoint.get(i)) / (this.upperBounds.get(i) - this.lowerBounds.get(i));
    }
 else {
      normalizeDiff=solution.getObjective(i) - this.interestPoint.get(i);
    }
    distance+=weights.get(i) * Math.pow(normalizeDiff,2.0D);
  }
  return Math.sqrt(distance);
}
Program: 64501
Project: 64501
Buggy source:
public PreferenceNSGAII(List<Double> weights,List<Double> interestPoint){
  this.weights=weights;
  this.interestPoint=interestPoint;
}

Fixed version (ground truth):
public PreferenceNSGAII(List<Double> weights){
  this.weights=weights;
}
Program: 64502
Project: 64502
Buggy source:
public void updatePointOfInterest(List<Double> newInterestPoint){
  if (this.interestPoint.size() != newInterestPoint.size()) {
    throw new JMetalException("String_Node_Str");
  }
 else {
    for (int i=0; i < newInterestPoint.size(); ++i) {
      this.interestPoint.set(i,newInterestPoint.get(i));
    }
  }
}

Fixed version (ground truth):
public void updatePointOfInterest(List<Double> newInterestPoint){
  interestPoint=newInterestPoint;
}
Program: 64503
Project: 64503
Buggy source:
public RNSGAIIRanking(PreferenceNSGAII<S> utilityFunctions,double epsilon){
  this.utilityFunctions=utilityFunctions;
  this.epsilon=epsilon;
}

Fixed version (ground truth):
public RNSGAIIRanking(PreferenceNSGAII<S> utilityFunctions,double epsilon,List<Double> interestPoint){
  this.utilityFunctions=utilityFunctions;
  this.epsilon=epsilon;
  referencePoint=interestPoint;
}
Program: 64504
Project: 64504
Buggy source:
public List<S> getSubfront(int rank){
  if (rank >= this.rankedSubpopulations.size()) {
    rank=this.rankedSubpopulations.size() - 1;
  }
  return (List)this.rankedSubpopulations.get(rank);
}

Fixed version (ground truth):
public List<S> getSubfront(int rank){
  return (List)this.rankedSubpopulations.get(rank);
}
Program: 64505
Project: 64505
Buggy source:
private void removeRank(S solution){
  boolean enc=false;
  int i=0;
  while (!enc && i < this.rankedSubpopulations.size()) {
    enc=this.rankedSubpopulations.get(i).contains(solution);
    if (enc) {
      this.rankedSubpopulations.get(i).remove(solution);
    }
    i++;
  }
}

Fixed version (ground truth):
private void removeRank(S solution){
  boolean enc=false;
  int i=0;
  while (i < this.rankedSubpopulations.size()) {
    enc=this.rankedSubpopulations.get(i).contains(solution);
    if (enc) {
      this.rankedSubpopulations.get(i).remove(solution);
    }
    i++;
  }
}
Program: 64507
Project: 64507
Buggy source:
/** 
 * initUniformWeight
 */
private void initUniformWeight(){
  if ((problem.getNumberOfObjectives() == 2) && (swarmSize < 300)) {
    for (int n=0; n < swarmSize; n++) {
      double a=1.0 * n / (swarmSize - 1);
      lambda[n][0]=a;
      lambda[n][1]=1 - a;
    }
  }
 else {
    String dataFileName;
    dataDirectory="String_Node_Str";
    dataFileName="String_Node_Str" + problem.getNumberOfObjectives() + "String_Node_Str"+ swarmSize+ "String_Node_Str";
    try {
      FileInputStream fis=new FileInputStream(dataDirectory + "String_Node_Str" + dataFileName);
      InputStreamReader isr=new InputStreamReader(fis);
      BufferedReader br=new BufferedReader(isr);
      int i=0;
      int j=0;
      String aux=br.readLine();
      while (aux != null) {
        StringTokenizer st=new StringTokenizer(aux);
        j=0;
        while (st.hasMoreTokens()) {
          double value=(new Double(st.nextToken())).doubleValue();
          lambda[i][j]=value;
          j++;
        }
        aux=br.readLine();
        i++;
      }
      br.close();
    }
 catch (    Exception e) {
      throw new JMetalException("String_Node_Str" + dataDirectory + "String_Node_Str"+ dataFileName);
    }
  }
}

Fixed version (ground truth):
/** 
 * initUniformWeight
 */
private void initUniformWeight(){
  if ((problem.getNumberOfObjectives() == 2) && (swarmSize < 300)) {
    for (int n=0; n < swarmSize; n++) {
      double a=1.0 * n / (swarmSize - 1);
      lambda[n][0]=a;
      lambda[n][1]=1 - a;
    }
  }
 else {
    String dataFileName;
    dataFileName="String_Node_Str" + problem.getNumberOfObjectives() + "String_Node_Str"+ swarmSize+ "String_Node_Str";
    try {
      InputStream in=getClass().getResourceAsStream("String_Node_Str" + dataDirectory + "String_Node_Str"+ dataFileName);
      InputStreamReader isr=new InputStreamReader(in);
      BufferedReader br=new BufferedReader(isr);
      int i=0;
      int j=0;
      String aux=br.readLine();
      while (aux != null) {
        StringTokenizer st=new StringTokenizer(aux);
        j=0;
        while (st.hasMoreTokens()) {
          double value=(new Double(st.nextToken())).doubleValue();
          lambda[i][j]=value;
          j++;
        }
        aux=br.readLine();
        i++;
      }
      br.close();
    }
 catch (    Exception e) {
      throw new JMetalException("String_Node_Str" + dataDirectory + "String_Node_Str"+ dataFileName);
    }
  }
}
Program: 64508
Project: 64508
Buggy source:
@Override protected void initProgress(){
  evaluations=1;
}

Fixed version (ground truth):
@Override protected void initProgress(){
  evaluations=mu;
}
Program: 64512
Project: 64512
Buggy source:
/** 
 * Constructor Creates a default instance of the Rosenbrock problem
 * @param numberOfVariables Number of variables of the problem
 */
public Rosenbrock(Integer numberOfVariables){
  setNumberOfVariables(numberOfVariables);
  setNumberOfObjectives(1);
  setNumberOfConstraints(0);
  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(-5.12);
    upperLimit.add(5.12);
  }
}

Fixed version (ground truth):
/** 
 * Constructor Creates a default instance of the Rosenbrock problem
 * @param numberOfVariables Number of variables of the problem
 */
public Rosenbrock(Integer numberOfVariables){
  setNumberOfVariables(numberOfVariables);
  setNumberOfObjectives(1);
  setNumberOfConstraints(0);
  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(-5.12);
    upperLimit.add(5.12);
  }
  setLowerLimit(lowerLimit);
  setUpperLimit(upperLimit);
}
Program: 64513
Project: 64513
Buggy source:
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;
      }
    }
  }
}

Fixed version (ground truth):
public void prune(){
  Iterator<S> iterator=getSolutionList().iterator();
  while (iterator.hasNext()) {
    S element=iterator.next();
    int location=grid.location(element);
    if (location == grid.getMostPopulatedHypercube()) {
      iterator.remove();
      grid.removeSolution(location);
      return;
    }
  }
}
Program: 64514
Project: 64514
Buggy source:
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;
      }
    }
  }
}

Fixed version (ground truth):
public void prune(){
  Iterator<S> iterator=getSolutionList().iterator();
  while (iterator.hasNext()) {
    S element=iterator.next();
    int location=grid.location(element);
    if (location == grid.getMostPopulatedHypercube()) {
      iterator.remove();
      grid.removeSolution(location);
      return;
    }
  }
}
Program: 64515
Project: 64515
Buggy source:
void alphaFunction(double alpha[],List<Double> x,int dim,int type){
  if (dim == 2) {
    if (type == 21) {
      alpha[0]=x.get(0);
      alpha[1]=1 - Math.sqrt(x.get(0));
    }
    if (type == 22) {
      alpha[0]=x.get(0);
      alpha[1]=1 - x.get(0) * x.get(0);
    }
    if (type == 23) {
      alpha[0]=x.get(0);
      alpha[1]=1 - Math.sqrt(alpha[0]) - alpha[0] * Math.sin(10 * alpha[0] * alpha[0]* Math.PI);
    }
    if (type == 24) {
      alpha[0]=x.get(0);
      alpha[1]=1 - x.get(0) - 0.05 * Math.sin(4 * Math.PI * x.get(0));
    }
  }
 else {
    if (type == 31) {
      alpha[1]=Math.cos(x.get(0) * Math.PI / 2) * Math.sin(x.get(1) * Math.PI / 2);
      alpha[2]=Math.sin(x.get(0) * Math.PI / 2);
    }
    if (type == 32) {
      alpha[0]=1 - Math.cos(x.get(0) * Math.PI / 2) * Math.cos(x.get(1) * Math.PI / 2);
      alpha[1]=1 - Math.cos(x.get(0) * Math.PI / 2) * Math.sin(x.get(1) * Math.PI / 2);
      alpha[2]=1 - Math.sin(x.get(0) * Math.PI / 2);
    }
    if (type == 33) {
      alpha[0]=x.get(0);
      alpha[1]=x.get(1);
      alpha[2]=3 - (Math.sin(3 * Math.PI * x.get(0)) + Math.sin(3 * Math.PI * x.get(1))) - 2 * (x.get(0) + x.get(1));
    }
    if (type == 34) {
      alpha[0]=x.get(0) * x.get(1);
      alpha[1]=x.get(0) * (1 - x.get(1));
      alpha[2]=(1 - x.get(0));
    }
  }
}

Fixed version (ground truth):
void alphaFunction(double alpha[],List<Double> x,int dim,int type){
  if (dim == 2) {
    if (type == 21) {
      alpha[0]=x.get(0);
      alpha[1]=1 - Math.sqrt(x.get(0));
    }
    if (type == 22) {
      alpha[0]=x.get(0);
      alpha[1]=1 - x.get(0) * x.get(0);
    }
    if (type == 23) {
      alpha[0]=x.get(0);
      alpha[1]=1 - Math.sqrt(alpha[0]) - alpha[0] * Math.sin(10 * alpha[0] * alpha[0]* Math.PI);
    }
    if (type == 24) {
      alpha[0]=x.get(0);
      alpha[1]=1 - x.get(0) - 0.05 * Math.sin(4 * Math.PI * x.get(0));
    }
  }
 else {
    if (type == 31) {
      alpha[0]=Math.cos(x.get(0) * Math.PI / 2) * Math.cos(x.get(1) * Math.PI / 2);
      alpha[1]=Math.cos(x.get(0) * Math.PI / 2) * Math.sin(x.get(1) * Math.PI / 2);
      alpha[2]=Math.sin(x.get(0) * Math.PI / 2);
    }
    if (type == 32) {
      alpha[0]=1 - Math.cos(x.get(0) * Math.PI / 2) * Math.cos(x.get(1) * Math.PI / 2);
      alpha[1]=1 - Math.cos(x.get(0) * Math.PI / 2) * Math.sin(x.get(1) * Math.PI / 2);
      alpha[2]=1 - Math.sin(x.get(0) * Math.PI / 2);
    }
    if (type == 33) {
      alpha[0]=x.get(0);
      alpha[1]=x.get(1);
      alpha[2]=3 - (Math.sin(3 * Math.PI * x.get(0)) + Math.sin(3 * Math.PI * x.get(1))) - 2 * (x.get(0) + x.get(1));
    }
    if (type == 34) {
      alpha[0]=x.get(0) * x.get(1);
      alpha[1]=x.get(0) * (1 - x.get(1));
      alpha[2]=(1 - x.get(0));
    }
  }
}
Program: 64516
Project: 64516
Buggy source:
@Override protected void updateProgress(){
  iterations.increment(1);
  ;
  updateLeadersDensityEstimator();
  for (double i=0; i < 1000000000; i++) {
    double v=i * i / 3.0;
  }
  solutionListMeasure.push(super.getResult());
}

Fixed version (ground truth):
@Override protected void updateProgress(){
  iterations.increment(1);
  ;
  updateLeadersDensityEstimator();
  solutionListMeasure.push(super.getResult());
}
Program: 64517
Project: 64517
Buggy source:
@Override synchronized public void measureGenerated(Long value){
  if ((value % 50 == 0)) {
    System.out.println("String_Node_Str" + value);
  }
}

Fixed version (ground truth):
@Override synchronized public void measureGenerated(Long value){
  if ((value % 10 == 0)) {
    System.out.println("String_Node_Str" + value);
  }
}
Program: 64519
Project: 64519
Buggy source:
/** 
 * Creates a new instance of problem CEC2009_UF4.
 * @param numberOfVariables Number of variables.
 * @param solutionType The solution type must "Real" or "BinaryReal".
 */
public UF4(String solutionType,Integer numberOfVariables){
  setNumberOfVariables(numberOfVariables);
  setNumberOfObjectives(2);
  setNumberOfConstraints(0);
  setName("String_Node_Str");
  List<Double> lowerLimit=new ArrayList<>(getNumberOfVariables());
  List<Double> upperLimit=new ArrayList<>(getNumberOfVariables());
  lowerLimit.add(0.0);
  upperLimit.add(1.0);
  for (int i=1; i < getNumberOfVariables(); i++) {
    lowerLimit.add(-2.0);
    upperLimit.add(2.0);
  }
  setLowerLimit(lowerLimit);
  setUpperLimit(upperLimit);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of problem CEC2009_UF4.
 * @param numberOfVariables Number of variables.
 */
public UF4(Integer numberOfVariables){
  setNumberOfVariables(numberOfVariables);
  setNumberOfObjectives(2);
  setNumberOfConstraints(0);
  setName("String_Node_Str");
  List<Double> lowerLimit=new ArrayList<>(getNumberOfVariables());
  List<Double> upperLimit=new ArrayList<>(getNumberOfVariables());
  lowerLimit.add(0.0);
  upperLimit.add(1.0);
  for (int i=1; i < getNumberOfVariables(); i++) {
    lowerLimit.add(-2.0);
    upperLimit.add(2.0);
  }
  setLowerLimit(lowerLimit);
  setUpperLimit(upperLimit);
}
Program: 64522
Project: 64522
Buggy source:
/** 
 * initUniformWeight
 */
private void initUniformWeight(){
  if ((problem.getNumberOfObjectives() == 2) && (swarmSize < 300)) {
    for (int n=0; n < swarmSize; n++) {
      double a=1.0 * n / (swarmSize - 1);
      lambda[n][0]=a;
      lambda[n][1]=1 - a;
    }
  }
 else {
    String dataFileName;
    dataDirectory="String_Node_Str";
    dataFileName="String_Node_Str" + problem.getNumberOfObjectives() + "String_Node_Str"+ swarmSize+ "String_Node_Str";
    try {
      FileInputStream fis=new FileInputStream(dataDirectory + "String_Node_Str" + dataFileName);
      InputStreamReader isr=new InputStreamReader(fis);
      BufferedReader br=new BufferedReader(isr);
      int i=0;
      int j=0;
      String aux=br.readLine();
      while (aux != null) {
        StringTokenizer st=new StringTokenizer(aux);
        j=0;
        while (st.hasMoreTokens()) {
          double value=(new Double(st.nextToken())).doubleValue();
          lambda[i][j]=value;
          j++;
        }
        aux=br.readLine();
        i++;
      }
      br.close();
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + dataDirectory + "String_Node_Str"+ dataFileName);
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * initUniformWeight
 */
private void initUniformWeight(){
  if ((problem.getNumberOfObjectives() == 2) && (swarmSize < 300)) {
    for (int n=0; n < swarmSize; n++) {
      double a=1.0 * n / (swarmSize - 1);
      lambda[n][0]=a;
      lambda[n][1]=1 - a;
    }
  }
 else {
    String dataFileName;
    dataDirectory="String_Node_Str";
    dataFileName="String_Node_Str" + problem.getNumberOfObjectives() + "String_Node_Str"+ swarmSize+ "String_Node_Str";
    try {
      FileInputStream fis=new FileInputStream(dataDirectory + "String_Node_Str" + dataFileName);
      InputStreamReader isr=new InputStreamReader(fis);
      BufferedReader br=new BufferedReader(isr);
      int i=0;
      int j=0;
      String aux=br.readLine();
      while (aux != null) {
        StringTokenizer st=new StringTokenizer(aux);
        j=0;
        while (st.hasMoreTokens()) {
          double value=(new Double(st.nextToken())).doubleValue();
          lambda[i][j]=value;
          j++;
        }
        aux=br.readLine();
        i++;
      }
      br.close();
    }
 catch (    Exception e) {
      throw new JMetalException("String_Node_Str" + dataDirectory + "String_Node_Str"+ dataFileName);
    }
  }
}
Program: 64523
Project: 64523
Buggy source:
/** 
 * Read a set of weight vector from a file
 * @param filePath A file containing the weight vectors
 * @return A set of weight vectors
 */
public static double[][] getWeightsFromFile(String filePath){
  double[][] weights=new double[0][0];
  Vector<double[]> listOfWeights=new Vector<double[]>();
  try {
    FileInputStream fis=new FileInputStream(filePath);
    InputStreamReader isr=new InputStreamReader(fis);
    BufferedReader br=new BufferedReader(isr);
    int numberOfObjectives=0;
    int i=0;
    int j=0;
    String aux=br.readLine();
    while (aux != null) {
      StringTokenizer st=new StringTokenizer(aux);
      j=0;
      numberOfObjectives=st.countTokens();
      double[] weight=new double[numberOfObjectives];
      while (st.hasMoreTokens()) {
        weight[j]=(new Double(st.nextToken())).doubleValue();
        j++;
      }
      listOfWeights.add(weight);
      aux=br.readLine();
      i++;
    }
    br.close();
    weights=new double[listOfWeights.size()][numberOfObjectives];
    for (int indexWeight=0; indexWeight < listOfWeights.size(); indexWeight++) {
      for (int indexOfObjective=0; indexOfObjective < numberOfObjectives; indexOfObjective++) {
        weights[indexWeight][indexOfObjective]=listOfWeights.get(indexWeight)[indexOfObjective];
      }
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + filePath);
    e.printStackTrace();
  }
  return weights;
}

Fixed version (ground truth):
/** 
 * Read a set of weight vector from a file
 * @param filePath A file containing the weight vectors
 * @return A set of weight vectors
 */
public static double[][] getWeightsFromFile(String filePath){
  double[][] weights=new double[0][0];
  Vector<double[]> listOfWeights=new Vector<double[]>();
  try {
    FileInputStream fis=new FileInputStream(filePath);
    InputStreamReader isr=new InputStreamReader(fis);
    BufferedReader br=new BufferedReader(isr);
    int numberOfObjectives=0;
    int i=0;
    int j=0;
    String aux=br.readLine();
    while (aux != null) {
      StringTokenizer st=new StringTokenizer(aux);
      j=0;
      numberOfObjectives=st.countTokens();
      double[] weight=new double[numberOfObjectives];
      while (st.hasMoreTokens()) {
        weight[j]=(new Double(st.nextToken())).doubleValue();
        j++;
      }
      listOfWeights.add(weight);
      aux=br.readLine();
      i++;
    }
    br.close();
    weights=new double[listOfWeights.size()][numberOfObjectives];
    for (int indexWeight=0; indexWeight < listOfWeights.size(); indexWeight++) {
      for (int indexOfObjective=0; indexOfObjective < numberOfObjectives; indexOfObjective++) {
        weights[indexWeight][indexOfObjective]=listOfWeights.get(indexWeight)[indexOfObjective];
      }
    }
  }
 catch (  Exception e) {
    throw new JMetalException("String_Node_Str" + filePath);
  }
  return weights;
}