Program: 149560
Project: 149560
Buggy source:
private void grow(SelectionStrategy selectionStrategy,Mutator mutator,Recombiner recombiner){
  if (individuals.size() >= populationSize)   return;
  ArrayList<Chromosome> newIndividuals=new ArrayList<Chromosome>(populationSize - individuals.size());
  final int minSize=Math.max(2,individuals.get(0).length());
  int target=minSize - individuals.size();
  if (target > 0) {
    int next=0;
    int fails=0;
    while (newIndividuals.size() < target && fails < failureLimit) {
      Chromosome c=mutator.mutate(individuals.get(next++ % individuals.size()));
      if (c != null && !isDuplicate(newIndividuals,c)) {
        newIndividuals.add(c);
        fails=0;
      }
 else {
        fails++;
      }
    }
    newIndividuals.addAll(individuals);
    individuals=newIndividuals;
    if (individuals.size() < 2)     return;
  }
  selectionStrategy.initialiseBreeding(individuals);
  target=populationSize - individuals.size();
  int previousSize=-1;
  int fails=0;
  while (newIndividuals.size() < target && fails < failureLimit) {
    previousSize=newIndividuals.size();
    ChromosomePair pair=selectionStrategy.next();
    Chromosome[] children=recombiner.cross(pair.c1,pair.c2);
    if (children != null && children.length != 0) {
      for (int i=0; i < children.length && newIndividuals.size() < target; i++) {
        Chromosome c=mutator.mutate(children[i]);
        if (c == null)         continue;
        if (isDuplicate(newIndividuals,c))         continue;
        newIndividuals.add(c);
      }
    }
    if (previousSize == newIndividuals.size())     fails++;
 else     fails=0;
  }
  selectionStrategy.finishBreeding();
  newIndividuals.addAll(individuals);
  individuals=newIndividuals;
}

Fixed version (ground truth):
private void grow(SelectionStrategy selectionStrategy,Mutator mutator,Recombiner recombiner){
  iteration++;
  if (tracker != null)   tracker.status("String_Node_Str",iteration);
  if (individuals.size() >= populationSize)   return;
  ArrayList<Chromosome> newIndividuals=new ArrayList<Chromosome>(populationSize - individuals.size());
  final int minSize=Math.max(2,individuals.get(0).length());
  int target=minSize - individuals.size();
  if (target > 0) {
    if (tracker != null)     tracker.progress(individuals.size(),populationSize);
    int next=0;
    int fails=0;
    while (newIndividuals.size() < target && fails < failureLimit) {
      Chromosome c=mutator.mutate(individuals.get(next++ % individuals.size()));
      if (c != null && !isDuplicate(newIndividuals,c)) {
        newIndividuals.add(c);
        fails=0;
        if (tracker != null)         tracker.progress(newIndividuals.size() + individuals.size(),populationSize);
      }
 else {
        fails++;
      }
    }
    newIndividuals.addAll(individuals);
    individuals=newIndividuals;
    if (individuals.size() < 2) {
      if (tracker != null)       tracker.progress(1);
      return;
    }
  }
  selectionStrategy.initialiseBreeding(individuals);
  target=populationSize - individuals.size();
  int previousSize=-1;
  int fails=0;
  while (newIndividuals.size() < target && fails < failureLimit) {
    previousSize=newIndividuals.size();
    ChromosomePair pair=selectionStrategy.next();
    Chromosome[] children=recombiner.cross(pair.c1,pair.c2);
    if (children != null && children.length != 0) {
      for (int i=0; i < children.length && newIndividuals.size() < target; i++) {
        Chromosome c=mutator.mutate(children[i]);
        if (c == null)         continue;
        if (isDuplicate(newIndividuals,c))         continue;
        newIndividuals.add(c);
      }
    }
    if (previousSize == newIndividuals.size())     fails++;
 else {
      fails=0;
      if (tracker != null)       tracker.progress(newIndividuals.size() + individuals.size(),populationSize);
    }
  }
  selectionStrategy.finishBreeding();
  newIndividuals.addAll(individuals);
  individuals=newIndividuals;
}