Program: 37809
Project: 37809
Buggy source:
public Organism doVariation(Generation parents,Generation offspring,Selection sel){
  GAParameters params=GAParameters.getParams();
  int verbosity=params.getVerbosity();
  Random rand=params.getRandom();
  if (pairs == null)   pairs=GAUtils.parsePairs(pairStrings);
  Cell pStruct=((StructureOrg)(sel.doSelection(parents,1)[0])).getCell();
  List<Site> newSites=new ArrayList<Site>();
  List<Vect> newVects=new ArrayList<Vect>(pStruct.getLatticeVectors());
  for (  Site s : pStruct.getSites())   newSites.add(s);
  int numExchanges;
  do {
    numExchanges=Math.round(Math.round(rand.nextGaussian() * sigmaExchanges + meanExchanges));
  }
 while (numExchanges == 0);
  for (int i=0; i < numExchanges; i++) {
    Set<String> pair=pairs.get(rand.nextInt(pairs.size()));
    Iterator<String> j=pair.iterator();
    String firstSymbol=j.next();
    String secondSymbol=j.next();
    int indexA, indexB;
    do {
      indexA=rand.nextInt(newSites.size());
    }
 while (!newSites.get(indexA).getElement().getSymbol().startsWith(firstSymbol));
    do {
      indexB=rand.nextInt(newSites.size());
    }
 while (!newSites.get(indexB).getElement().getSymbol().startsWith(secondSymbol));
    Element elemA=newSites.get(indexA).getElement();
    Element elemB=newSites.get(indexB).getElement();
    newSites.set(indexA,new Site(elemB,newSites.get(indexA).getCoords()));
    newSites.set(indexB,new Site(elemA,newSites.get(indexB).getCoords()));
    if (verbosity >= 4)     System.out.println("String_Node_Str" + newSites.get(indexA).getElement() + "String_Node_Str"+ newSites.get(indexB).getElement());
  }
  return new StructureOrg(new Cell(newVects,newSites));
}

Fixed version (ground truth):
public Organism doVariation(Generation parents,Generation offspring,Selection sel){
  GAParameters params=GAParameters.getParams();
  int verbosity=params.getVerbosity();
  Random rand=params.getRandom();
  if (pairs == null)   pairs=GAUtils.parsePairs(pairStrings);
  Cell pStruct=((StructureOrg)(sel.doSelection(parents,1)[0])).getCell();
  List<Site> newSites=new ArrayList<Site>();
  List<Vect> newVects=new ArrayList<Vect>(pStruct.getLatticeVectors());
  for (  Site s : pStruct.getSites())   newSites.add(s);
  int numExchanges;
  do {
    numExchanges=Math.round(Math.round(rand.nextGaussian() * sigmaExchanges + meanExchanges));
  }
 while (numExchanges == 0);
  for (int i=0; i < numExchanges; i++) {
    Set<String> pair=pairs.get(rand.nextInt(pairs.size()));
    Iterator<String> j=pair.iterator();
    String firstSymbol=j.next();
    String secondSymbol=j.next();
    if (pStruct.getNumSitesWithElement(Element.getElemFromSymbol(firstSymbol)) == 0 || pStruct.getNumSitesWithElement(Element.getElemFromSymbol(secondSymbol)) == 0)     continue;
    int indexA, indexB;
    do {
      indexA=rand.nextInt(newSites.size());
    }
 while (!newSites.get(indexA).getElement().getSymbol().startsWith(firstSymbol));
    do {
      indexB=rand.nextInt(newSites.size());
    }
 while (!newSites.get(indexB).getElement().getSymbol().startsWith(secondSymbol));
    Element elemA=newSites.get(indexA).getElement();
    Element elemB=newSites.get(indexB).getElement();
    newSites.set(indexA,new Site(elemB,newSites.get(indexA).getCoords()));
    newSites.set(indexB,new Site(elemA,newSites.get(indexB).getCoords()));
    if (verbosity >= 4)     System.out.println("String_Node_Str" + newSites.get(indexA).getElement() + "String_Node_Str"+ newSites.get(indexB).getElement());
  }
  return new StructureOrg(new Cell(newVects,newSites));
}