Program: 64697
Project: 64697
Buggy source:
/** 
 * Runs the NSGA-II algorithm.
 * @return a <code>SolutionSet</code> that is a set of non dominated solutionsas a result of the algorithm execution
 * @throws org.uma.jmetal.util.JMetalException
 */
public SolutionSet execute() throws JMetalException, ClassNotFoundException {
  createInitialPopulation();
  evaluatePopulation(population_);
  evaluations_+=population_.size();
  while (!stoppingCondition()) {
    offspringPopulation_=new SolutionSet(populationSize_);
    for (int i=0; i < (populationSize_ / 2); i++) {
      if (!stoppingCondition()) {
        Solution[] parents=new Solution[2];
        parents[0]=(Solution)selectionOperator_.execute(population_);
        parents[1]=(Solution)selectionOperator_.execute(population_);
        Solution[] offSpring=(Solution[])crossoverOperator_.execute(parents);
        mutationOperator_.execute(offSpring[0]);
        mutationOperator_.execute(offSpring[1]);
        offspringPopulation_.add(offSpring[0]);
        offspringPopulation_.add(offSpring[1]);
      }
    }
    evaluatePopulation(offspringPopulation_);
    evaluations_+=offspringPopulation_.size();
    Ranking ranking=new Ranking(population_.union(offspringPopulation_));
    population_.clear();
    int rankingIndex=0;
    while (populationIsNotFull()) {
      if (subfrontFillsIntoThePopulation(ranking,rankingIndex)) {
        addRankedSolutionsToPopulation(ranking,rankingIndex);
        rankingIndex++;
      }
 else {
        computeCrowdingDistance(ranking,rankingIndex);
        addLastRankedSolutions(ranking,rankingIndex);
      }
    }
  }
  tearDown();
  return getNonDominatedSolutions();
}

Fixed version (ground truth):
/** 
 * Runs the NSGA-II algorithm.
 * @return a <code>SolutionSet</code> that is a set of non dominated solutionsas a result of the algorithm execution
 * @throws org.uma.jmetal.util.JMetalException
 */
public SolutionSet execute() throws JMetalException, ClassNotFoundException {
  createInitialPopulation();
  population_=evaluatePopulation(population_);
  evaluations_+=population_.size();
  while (!stoppingCondition()) {
    offspringPopulation_=new SolutionSet(populationSize_);
    for (int i=0; i < (populationSize_ / 2); i++) {
      if (!stoppingCondition()) {
        Solution[] parents=new Solution[2];
        parents[0]=(Solution)selectionOperator_.execute(population_);
        parents[1]=(Solution)selectionOperator_.execute(population_);
        Solution[] offSpring=(Solution[])crossoverOperator_.execute(parents);
        mutationOperator_.execute(offSpring[0]);
        mutationOperator_.execute(offSpring[1]);
        offspringPopulation_.add(offSpring[0]);
        offspringPopulation_.add(offSpring[1]);
      }
    }
    offspringPopulation_=evaluatePopulation(offspringPopulation_);
    evaluations_+=offspringPopulation_.size();
    Ranking ranking=new Ranking(population_.union(offspringPopulation_));
    population_.clear();
    int rankingIndex=0;
    while (populationIsNotFull()) {
      if (subfrontFillsIntoThePopulation(ranking,rankingIndex)) {
        addRankedSolutionsToPopulation(ranking,rankingIndex);
        rankingIndex++;
      }
 else {
        computeCrowdingDistance(ranking,rankingIndex);
        addLastRankedSolutions(ranking,rankingIndex);
      }
    }
  }
  tearDown();
  return getNonDominatedSolutions();
}