Program: 64694
Project: 64694
Buggy source:
/** 
 * Runs of the sMOCell2 algorithm.
 * @return a <code>SolutionSet</code> that is a set of non dominated solutionsas a experimentoutput of the algorithm execution
 * @throws org.uma.jmetal.util.JMetalException
 */
public SolutionSet execute() throws JMetalException, ClassNotFoundException {
  SolutionSet newSolutionSet;
  population=new SolutionSet(populationSize);
  archive=new CrowdingArchive(archiveSize,problem_.getNumberOfObjectives());
  neighborhood=new Neighborhood(populationSize);
  neighbors=new SolutionSet[populationSize];
  evaluations=0;
  createInitialPopulation();
  while (!stoppingCondition()) {
    newSolutionSet=new SolutionSet(populationSize);
    for (int ind=0; ind < population.size(); ind++) {
      Solution individual=new Solution(population.get(ind));
      Solution[] parents=new Solution[2];
      Solution[] offSpring;
      neighbors[ind]=neighborhood.getEightNeighbors(population,ind);
      neighbors[ind].add(individual);
      parents[0]=(Solution)selectionOperator.execute(neighbors[ind]);
      if (archive.size() > 0) {
        parents[1]=(Solution)selectionOperator.execute(archive);
      }
 else {
        parents[1]=(Solution)selectionOperator.execute(neighbors[ind]);
      }
      offSpring=(Solution[])crossoverOperator.execute(parents);
      mutationOperator.execute(offSpring[0]);
      problem_.evaluate(offSpring[0]);
      problem_.evaluateConstraints(offSpring[0]);
      evaluations++;
      int flag=dominanceComparator.compare(individual,offSpring[0]);
      if (flag == -1) {
        newSolutionSet.add(new Solution(population.get(ind)));
      }
      if (flag == 1) {
        offSpring[0].setLocation(individual.getLocation());
        newSolutionSet.add(offSpring[0]);
        archive.add(new Solution(offSpring[0]));
      }
 else       if (flag == 0) {
        neighbors[ind].add(offSpring[0]);
        Ranking rank=new Ranking(neighbors[ind]);
        for (int j=0; j < rank.getNumberOfSubfronts(); j++) {
          Distance.crowdingDistance(rank.getSubfront(j));
        }
        boolean deleteMutant=true;
        int compareResult=densityEstimatorComparator.compare(individual,offSpring[0]);
        if (compareResult == 1) {
          deleteMutant=false;
        }
        if (!deleteMutant) {
          offSpring[0].setLocation(individual.getLocation());
          newSolutionSet.add(offSpring[0]);
          archive.add(new Solution(offSpring[0]));
        }
 else {
          newSolutionSet.add(new Solution(population.get(ind)));
          archive.add(new Solution(offSpring[0]));
        }
      }
    }
    population=newSolutionSet;
  }
  return archive;
}

Fixed version (ground truth):
/** 
 * execute() method 
 */
public SolutionSet execute() throws JMetalException, ClassNotFoundException {
  SolutionSet newSolutionSet;
  archive=new CrowdingArchive(archiveSize,problem_.getNumberOfObjectives());
  neighborhood=new Neighborhood(populationSize);
  neighbors=new SolutionSet[populationSize];
  createInitialPopulation();
  population=evaluatePopulation(population);
  evaluations=population.size();
  while (!stoppingCondition()) {
    newSolutionSet=new SolutionSet(populationSize);
    for (int ind=0; ind < population.size(); ind++) {
      Solution individual=new Solution(population.get(ind));
      Solution[] parents=new Solution[2];
      Solution[] offSpring;
      neighbors[ind]=neighborhood.getEightNeighbors(population,ind);
      neighbors[ind].add(individual);
      parents[0]=(Solution)selectionOperator.execute(neighbors[ind]);
      if (archive.size() > 0) {
        parents[1]=(Solution)selectionOperator.execute(archive);
      }
 else {
        parents[1]=(Solution)selectionOperator.execute(neighbors[ind]);
      }
      offSpring=(Solution[])crossoverOperator.execute(parents);
      mutationOperator.execute(offSpring[0]);
      problem_.evaluate(offSpring[0]);
      problem_.evaluateConstraints(offSpring[0]);
      evaluations++;
      int flag=dominanceComparator.compare(individual,offSpring[0]);
      if (flag == -1) {
        newSolutionSet.add(new Solution(population.get(ind)));
      }
 else       if (flag == 1) {
        offSpring[0].setLocation(individual.getLocation());
        newSolutionSet.add(offSpring[0]);
        archive.add(new Solution(offSpring[0]));
      }
 else       if (flag == 0) {
        neighbors[ind].add(offSpring[0]);
        Ranking rank=new Ranking(neighbors[ind]);
        for (int j=0; j < rank.getNumberOfSubfronts(); j++) {
          Distance.crowdingDistance(rank.getSubfront(j));
        }
        boolean deleteMutant=true;
        int compareResult=densityEstimatorComparator.compare(individual,offSpring[0]);
        if (compareResult == 1) {
          deleteMutant=false;
        }
        if (!deleteMutant) {
          offSpring[0].setLocation(individual.getLocation());
          newSolutionSet.add(offSpring[0]);
          archive.add(new Solution(offSpring[0]));
        }
 else {
          newSolutionSet.add(new Solution(population.get(ind)));
          archive.add(new Solution(offSpring[0]));
        }
      }
    }
    population=newSolutionSet;
  }
  return archive;
}