Program: 64733
Project: 64733
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 jmetal.util.JMException
 */
public SolutionSet execute() throws JMException, ClassNotFoundException {
  readParameterSettings();
  population_=createInitialPopulation(populationSize_);
  evaluatePopulation(population_);
  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_);
    Ranking ranking=rankPopulation();
    population_.clear();
    int rankingIndex=0;
    while (population_.size() < populationSize_) {
      if (subfrontFillsIntoThePopulation(ranking,rankingIndex)) {
        addRankedSolutionsToPopulation(ranking,rankingIndex);
        rankingIndex++;
      }
 else {
        computeCrowdingDistance(ranking,rankingIndex);
        addLastRankedSolutions(ranking,rankingIndex);
      }
    }
  }
  Ranking ranking=new Ranking(population_);
  return ranking.getSubfront(0);
}

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 jmetal.util.JMException
 */
public SolutionSet execute() throws JMException, ClassNotFoundException {
  readParameterSettings();
  population_=createInitialPopulation(populationSize_);
  evaluatePopulation(population_);
  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_);
    Ranking ranking=rankPopulation();
    population_.clear();
    int rankingIndex=0;
    while (populationIsNotFull()) {
      if (subfrontFillsIntoThePopulation(ranking,rankingIndex)) {
        addRankedSolutionsToPopulation(ranking,rankingIndex);
        rankingIndex++;
      }
 else {
        computeCrowdingDistance(ranking,rankingIndex);
        addLastRankedSolutions(ranking,rankingIndex);
      }
    }
  }
  Ranking ranking=new Ranking(population_);
  evaluator_.shutdown();
  return ranking.getSubfront(0);
}