Program: 125157
Project: 125157
Buggy source:
/** 
 * Main function implementing new heuristics in ASTRAL-II. At this point, we require a subsample with a single individual per species.
 * @param trees : the input trees contracted to the subsample
 * @param sis : the single-individual subsample information
 */
void addExtraBipartitionByHeuristics(Collection<Tree> contractedTrees,TaxonIdentifier tid,SimilarityMatrix sm){
  Collection<Tree> allGreedies;
  this.addExtraBipartitionByDistance();
  System.err.println("String_Node_Str");
  for (  Tree tree : contractedTrees) {
    tree.rerootTreeAtEdge(tid.getTaxonName(0));
    Trees.removeBinaryNodes((MutableTree)tree);
  }
  allGreedies=Utils.greedyConsensus(contractedTrees,this.GREEDY_ADDITION_THRESHOLDS,true,1,tid,true);
  int th=0;
  for (  Tree cons : allGreedies) {
    double thresh=this.GREEDY_ADDITION_THRESHOLDS[th];
    System.err.println("String_Node_Str" + thresh + "String_Node_Str");
    th=(th + 1) % this.GREEDY_ADDITION_THRESHOLDS.length;
    for (    TNode greedyNode : cons.postTraverse()) {
      if (greedyNode.isLeaf()) {
        continue;
      }
      long maxSize=this.GREEDY_ADDITION_MAX_POLYTOMY_MIN + Math.round(Math.sqrt(tid.taxonCount() * this.GREEDY_ADDITION_MAX_POLYTOMY_MULT));
      if (greedyNode.getChildCount() <= 2 || greedyNode.getChildCount() > maxSize) {
        continue;
      }
      BitSet greedyBS=(BitSet)((STITreeCluster)((STINode)greedyNode).getData()).getBitSet();
      BitSet[] childbs=new BitSet[greedyNode.getChildCount() + 1];
      int i=0;
      for (      TNode c : greedyNode.getChildren()) {
        childbs[i]=(BitSet)((STITreeCluster)((STINode)c).getData()).getBitSet();
        ;
        i++;
      }
      BitSet comp=(BitSet)greedyBS.clone();
      comp.flip(0,tid.taxonCount());
      childbs[i]=comp;
      System.err.print("String_Node_Str" + greedyNode.getChildCount());
      this.addSubSampledBitSetToX(this.speciesSimilarityMatrix.resolveByUPGMA(Arrays.asList(childbs),true),tid);
      int k=0;
      for (int j=0; j < this.GREEDY_ADDITION_DEFAULT_RUNS + k; j++) {
        boolean quadratic=this.SLOW || (th <= this.GREEDY_DIST_ADDITTION_LAST_THRESHOLD_INDX && j < this.GREEDY_ADDITION_DEFAULT_RUNS);
        if (this.sampleAndResolve(childbs,quadratic,sm,tid)) {
          k+=this.GREEDY_ADDITION_IMPROVEMENT_REWARD;
        }
      }
      System.err.println("String_Node_Str" + this.GREEDY_ADDITION_MIN_FREQ + "String_Node_Str"+ k / this.GREEDY_ADDITION_IMPROVEMENT_REWARD + "String_Node_Str" + clusters.getClusterCount());
    }
  }
}

Fixed version (ground truth):
/** 
 * Main function implementing new heuristics in ASTRAL-II. At this point, we require a subsample with a single individual per species.
 * @param trees : the input trees contracted to the subsample
 * @param sis : the single-individual subsample information
 */
void addExtraBipartitionByHeuristics(Collection<Tree> contractedTrees,TaxonIdentifier tid,SimilarityMatrix sm){
  Collection<Tree> allGreedies;
  this.addExtraBipartitionByDistance();
  System.err.println("String_Node_Str");
  for (  Tree tree : contractedTrees) {
    tree.rerootTreeAtEdge(tid.getTaxonName(0));
    Trees.removeBinaryNodes((MutableTree)tree);
  }
  allGreedies=Utils.greedyConsensus(contractedTrees,this.GREEDY_ADDITION_THRESHOLDS,true,1,tid,true);
  int th=0;
  for (  Tree cons : allGreedies) {
    double thresh=this.GREEDY_ADDITION_THRESHOLDS[th];
    System.err.println("String_Node_Str" + thresh + "String_Node_Str");
    for (    TNode greedyNode : cons.postTraverse()) {
      if (greedyNode.isLeaf()) {
        continue;
      }
      long maxSize=this.GREEDY_ADDITION_MAX_POLYTOMY_MIN + Math.round(Math.sqrt(tid.taxonCount() * this.GREEDY_ADDITION_MAX_POLYTOMY_MULT));
      if (greedyNode.getChildCount() <= 2 || greedyNode.getChildCount() > maxSize) {
        continue;
      }
      BitSet greedyBS=(BitSet)((STITreeCluster)((STINode)greedyNode).getData()).getBitSet();
      BitSet[] childbs=new BitSet[greedyNode.getChildCount() + 1];
      int i=0;
      for (      TNode c : greedyNode.getChildren()) {
        childbs[i]=(BitSet)((STITreeCluster)((STINode)c).getData()).getBitSet();
        ;
        i++;
      }
      BitSet comp=(BitSet)greedyBS.clone();
      comp.flip(0,tid.taxonCount());
      childbs[i]=comp;
      System.err.print("String_Node_Str" + greedyNode.getChildCount());
      this.addSubSampledBitSetToX(this.speciesSimilarityMatrix.resolveByUPGMA(Arrays.asList(childbs),true),tid);
      int k=0;
      for (int j=0; j < this.GREEDY_ADDITION_DEFAULT_RUNS + k; j++) {
        boolean quadratic=this.SLOW || (th < this.GREEDY_DIST_ADDITTION_LAST_THRESHOLD_INDX && j < this.GREEDY_ADDITION_DEFAULT_RUNS);
        if (this.sampleAndResolve(childbs,quadratic,sm,tid)) {
          k+=this.GREEDY_ADDITION_IMPROVEMENT_REWARD;
        }
      }
      System.err.println("String_Node_Str" + this.GREEDY_ADDITION_MIN_FREQ + "String_Node_Str"+ k / this.GREEDY_ADDITION_IMPROVEMENT_REWARD + "String_Node_Str" + clusters.getClusterCount());
    }
    th=(th + 1) % this.GREEDY_ADDITION_THRESHOLDS.length;
  }
}