Program: 180736
Project: 180736
Buggy source:
private void run(){
  List<CandidateProgram<TYPE>> pop=model.getInitialiser().getInitialPopulation();
  genStats.addGen(pop,0,0,0,0);
  genloop:   for (int i=1; i <= model.getNoGenerations(); i++) {
    long genStartTime=System.nanoTime();
    int popSize=model.getPopulationSize();
    List<CandidateProgram<TYPE>> nextPop=new ArrayList<CandidateProgram<TYPE>>(popSize);
    int noElites=model.getNoElites();
    noElites=(noElites < popSize) ? noElites : popSize;
    nextPop.addAll(GPElitism.getElites(pop,noElites));
    List<CandidateProgram<TYPE>> pool=model.getPoolSelector().getPool(pop,model.getPoolSize());
    int crossoverReversions=0;
    int mutationReversions=0;
    model.getProgramSelector().onGenerationStart(pool);
    while (nextPop.size() < model.getPopulationSize()) {
      double random=model.getRNG().nextDouble();
      double pm=model.getMutationProbability();
      double pe=model.getCrossoverProbability();
      if (random < pe) {
        CandidateProgram<TYPE>[] children=crossover.crossover();
        for (        CandidateProgram<TYPE> c : children) {
          if (nextPop.size() < model.getPopulationSize())           nextPop.add(c);
        }
        crossoverReversions+=crossover.getRevertedCount();
      }
 else       if (random < pe + pm) {
        nextPop.add(mutation.mutate());
        mutationReversions+=mutation.getRevertedCount();
      }
 else {
        nextPop.add(pool.get(model.getRNG().nextInt(pool.size())));
      }
    }
    for (    CandidateProgram<TYPE> p : pop) {
      double fitness=model.getFitness(p);
      if (fitness < bestFitness) {
        bestFitness=fitness;
        bestProgram=p;
        if (bestFitness <= model.getTerminationFitness()) {
          break genloop;
        }
      }
    }
    long runtime=System.nanoTime() - genStartTime;
    genStats.addGen(nextPop,i,runtime,crossoverReversions,mutationReversions);
    pop=nextPop;
  }
  runEndTime=System.nanoTime();
}

Fixed version (ground truth):
private void run(){
  List<CandidateProgram<TYPE>> pop=model.getInitialiser().getInitialPopulation();
  genStats.addGen(pop,0,0,0,0);
  genloop:   for (int i=1; i <= model.getNoGenerations(); i++) {
    long genStartTime=System.nanoTime();
    int popSize=model.getPopulationSize();
    List<CandidateProgram<TYPE>> nextPop=new ArrayList<CandidateProgram<TYPE>>(popSize);
    int noElites=model.getNoElites();
    noElites=(noElites < popSize) ? noElites : popSize;
    nextPop.addAll(GPElitism.getElites(pop,noElites));
    List<CandidateProgram<TYPE>> pool=model.getPoolSelector().getPool(pop,model.getPoolSize());
    int crossoverReversions=0;
    int mutationReversions=0;
    model.getProgramSelector().onGenerationStart(pool);
    while (nextPop.size() < model.getPopulationSize()) {
      double random=model.getRNG().nextDouble();
      double pm=model.getMutationProbability();
      double pe=model.getCrossoverProbability();
      if (random < pe) {
        CandidateProgram<TYPE>[] children=crossover.crossover();
        for (        CandidateProgram<TYPE> c : children) {
          if (nextPop.size() < model.getPopulationSize())           nextPop.add(c);
        }
        crossoverReversions+=crossover.getRevertedCount();
      }
 else       if (random < pe + pm) {
        nextPop.add(mutation.mutate());
        mutationReversions+=mutation.getRevertedCount();
      }
 else {
        nextPop.add(pool.get(model.getRNG().nextInt(pool.size())));
      }
    }
    for (    CandidateProgram<TYPE> p : nextPop) {
      double fitness=model.getFitness(p);
      if (fitness < bestFitness) {
        bestFitness=fitness;
        bestProgram=p;
        if (bestFitness <= model.getTerminationFitness()) {
          break genloop;
        }
      }
    }
    long runtime=System.nanoTime() - genStartTime;
    genStats.addGen(nextPop,i,runtime,crossoverReversions,mutationReversions);
    pop=nextPop;
  }
  runEndTime=System.nanoTime();
}