Program: 125163
Project: 125163
Buggy source:
void traverseTrees(List<Tree> trees,boolean addTripartition,Map<Tripartition,Integer> geneTreeTripartitonCount,boolean complete){
  System.err.println("String_Node_Str");
  int t=0;
  for (  Tree tr : trees) {
    Stack<STITreeCluster> stack=new Stack<STITreeCluster>();
    STITreeCluster gtAll=this.treeAllClusters.get(t++);
    BitSet gtAllBS=gtAll.getBitSet();
    int[] neighbor=null;
    if (complete) {
      neighbor=new int[GlobalMaps.taxonIdentifier.taxonCount()];
      for (int i=gtAllBS.nextClearBit(0); i < n; i=gtAllBS.nextClearBit(i + 1)) {
        for (int j=0; ; j++) {
          if (i > this.orderedTaxonByDist[i][j] || gtAllBS.get(this.orderedTaxonByDist[i][j])) {
            neighbor[i]=this.orderedTaxonByDist[i][j];
            break;
          }
          if (j > GlobalMaps.taxonIdentifier.taxonCount()) {
            throw new RuntimeException("String_Node_Str");
          }
        }
      }
    }
    for (    TNode node : tr.postTraverse()) {
      if (node.isLeaf()) {
        String nodeName=node.getName();
        STITreeCluster cluster=new STITreeCluster();
        Integer taxonID=GlobalMaps.taxonIdentifier.taxonId(nodeName);
        cluster.addLeaf(taxonID);
        STITreeCluster remaining=cluster.complementaryCluster();
        remaining.getBitSet().and(gtAll.getBitSet());
        addBipartitionToX(gtAllBS,cluster,remaining,neighbor);
        stack.add(cluster);
      }
 else {
        ArrayList<STITreeCluster> childbslist=new ArrayList<STITreeCluster>();
        BitSet bs=new BitSet(GlobalMaps.taxonIdentifier.taxonCount());
        for (        TNode child : node.getChildren()) {
          STITreeCluster pop=stack.pop();
          childbslist.add(pop);
          bs.or(pop.getBitSet());
        }
        STITreeCluster cluster=new STITreeCluster();
        cluster.setCluster((BitSet)bs.clone());
        stack.add(cluster);
        STITreeCluster remaining=cluster.complementaryCluster();
        remaining.getBitSet().and(gtAll.getBitSet());
        if (addBipartitionToX(gtAllBS,cluster,remaining,neighbor)) {
        }
        if (addTripartition) {
          if (remaining.getClusterSize() != 0) {
            childbslist.add(remaining);
          }
          for (int i=0; i < childbslist.size(); i++) {
            for (int j=i + 1; j < childbslist.size(); j++) {
              for (int k=j + 1; k < childbslist.size(); k++) {
                addTripartition(childbslist.get(i),childbslist.get(j),childbslist.get(k),node,geneTreeTripartitonCount);
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
void traverseTrees(List<Tree> trees,boolean addTripartition,Map<Tripartition,Integer> geneTreeTripartitonCount,boolean complete,List<STITreeCluster> treeCompteleClusters){
  System.err.println("String_Node_Str");
  int t=0;
  for (  Tree tr : trees) {
    Stack<STITreeCluster> stack=new Stack<STITreeCluster>();
    STITreeCluster gtAll=treeCompteleClusters.get(t++);
    BitSet gtAllBS=gtAll.getBitSet();
    int[] neighbor=null;
    if (complete) {
      neighbor=new int[GlobalMaps.taxonIdentifier.taxonCount()];
      for (int i=gtAllBS.nextClearBit(0); i < n; i=gtAllBS.nextClearBit(i + 1)) {
        for (int j=0; ; j++) {
          if (i > this.orderedTaxonByDist[i][j] || gtAllBS.get(this.orderedTaxonByDist[i][j])) {
            neighbor[i]=this.orderedTaxonByDist[i][j];
            break;
          }
          if (j > GlobalMaps.taxonIdentifier.taxonCount()) {
            throw new RuntimeException("String_Node_Str");
          }
        }
      }
    }
    for (    TNode node : tr.postTraverse()) {
      if (node.isLeaf()) {
        String nodeName=node.getName();
        STITreeCluster cluster=new STITreeCluster();
        Integer taxonID=GlobalMaps.taxonIdentifier.taxonId(nodeName);
        cluster.addLeaf(taxonID);
        STITreeCluster remaining=cluster.complementaryCluster();
        remaining.getBitSet().and(gtAll.getBitSet());
        addBipartitionToX(gtAllBS,cluster,remaining,neighbor);
        stack.add(cluster);
      }
 else {
        ArrayList<STITreeCluster> childbslist=new ArrayList<STITreeCluster>();
        BitSet bs=new BitSet(GlobalMaps.taxonIdentifier.taxonCount());
        for (        TNode child : node.getChildren()) {
          STITreeCluster pop=stack.pop();
          childbslist.add(pop);
          bs.or(pop.getBitSet());
        }
        STITreeCluster cluster=new STITreeCluster();
        cluster.setCluster((BitSet)bs.clone());
        stack.add(cluster);
        STITreeCluster remaining=cluster.complementaryCluster();
        remaining.getBitSet().and(gtAll.getBitSet());
        if (addBipartitionToX(gtAllBS,cluster,remaining,neighbor)) {
        }
        if (addTripartition) {
          if (remaining.getClusterSize() != 0) {
            childbslist.add(remaining);
          }
          for (int i=0; i < childbslist.size(); i++) {
            for (int j=i + 1; j < childbslist.size(); j++) {
              for (int k=j + 1; k < childbslist.size(); k++) {
                addTripartition(childbslist.get(i),childbslist.get(j),childbslist.get(k),node,geneTreeTripartitonCount);
              }
            }
          }
        }
      }
    }
  }
}