Program: 50158
Project: 50158
Buggy source:
private void createLicaNodesFromBiparts(List<Tree> trees){
  nestedParents=newIntegerListArray(bipart.length);
  nestedChildren=newIntegerListArray(bipart.length);
  nestedAugmentingParents=newIntegerListArray(bipart.length);
  System.out.println("String_Node_Str");
  long z=new Date().getTime();
  for (int i=0; i < trees.size(); i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ trees.get(i).internalNodeCount()+ "String_Node_Str");
    for (    TreeNode c : trees.get(i).internalNodes(NodeOrder.POSTORDER)) {
      if (c.isTheRoot()) {
        continue;
      }
      int cid=treeNodeIds.get(c);
      for (TreeNode p=c.getParent(); !p.isTheRoot(); p=p.getParent()) {
        int pid=treeNodeIds.get(p);
        nestedParents[pid].add(cid);
        nestedChildren[cid].add(pid);
      }
    }
    Tree P=trees.get(i);
    List<TreeNode> pRootChildren=P.getRoot().getChildren();
    for (int j=0; j < trees.size(); j++) {
      if (i == j) {
        continue;
      }
      List<TreeNode> qRootChildren=trees.get(j).getRoot().getChildren();
      boolean treesHaveIdenticalTaxa=original[treeNodeIds.get(pRootChildren.get(0))].hasIdenticalTaxonSetAs(original[treeNodeIds.get(qRootChildren.get(0))]);
      LinkedList<TreeNode> pStack=new LinkedList<TreeNode>();
      for (pStack.addAll(pRootChildren); !pStack.isEmpty(); ) {
        TreeNode p=pStack.pop();
        if (p.isExternal()) {
          continue;
        }
        int pid=treeNodeIds.get(p);
        TLongBipartition bp=original[pid];
        LinkedList<TreeNode> qStack=new LinkedList<TreeNode>();
        for (qStack.addAll(qRootChildren); !qStack.isEmpty(); ) {
          TreeNode q=qStack.pop();
          if (q.isExternal()) {
            continue;
          }
          int qid=treeNodeIds.get(q);
          TLongBipartition bq=original[qid];
          if (bq.isNestedPartitionOf(bp)) {
            nestedParents[pid].add(qid);
            nestedChildren[qid].add(pid);
            if (!treesHaveIdenticalTaxa) {
              nestedAugmentingParents[pid].add(qid);
            }
          }
          if (bq.ingroup().containsAny(bp.ingroup())) {
            for (            TreeNode qc : q.getChildren()) {
              qStack.push(qc);
            }
          }
        }
      }
    }
    for (    TreeNode node : P.internalNodes(NodeOrder.PREORDER)) {
      if (node.isTheRoot()) {
        continue;
      }
      final int child=treeNodeIds.get(node);
      List<Integer> moreParents=summedBipartIds.parallelStream().map(parent -> {
        return bipart[child].isNestedPartitionOf(bipart[parent]) ? parent : null;
      }
).collect(toList()).stream().filter(a -> a != null).collect(toList());
      for (      Integer parent : moreParents) {
        nestedParents[child].add(parent);
        nestedChildren[parent].add(child);
      }
    }
  }
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str");
  paths=new HashSet<Path>();
  System.out.print("String_Node_Str");
  z=new Date().getTime();
  Transaction tx=gdb.beginTx();
  for (int i=0; i < bipart.length; i++) {
    if (bipart[i].outgroup().size() > 0) {
      CompactLongSet pathResult=findPaths(i,new CompactLongSet(),new ArrayList<Integer>(),0,i);
      if (pathResult == null) {
        createNode(bipart[i]);
      }
    }
  }
  tx.success();
  tx.finish();
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str" + paths.size());
  if (VERBOSE) {
    for (    Path p : paths) {
      System.out.println(p);
    }
  }
  System.out.print("String_Node_Str");
  z=new Date().getTime();
  tx=gdb.beginTx();
  for (  Path p : paths) {
    generateNodesFromPaths(0,new CompactLongSet(),p.toArray());
  }
  tx.success();
  tx.finish();
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str");
}

Fixed version (ground truth):
private void createLicaNodesFromBiparts(List<Tree> trees){
  nestedParents=newIntegerListArray(bipart.length);
  nestedChildren=newIntegerListArray(bipart.length);
  nestedAugmentingParents=newIntegerListArray(bipart.length);
  System.out.println("String_Node_Str");
  long z=new Date().getTime();
  for (int i=0; i < trees.size(); i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ trees.get(i).internalNodeCount()+ "String_Node_Str");
    for (    TreeNode c : trees.get(i).internalNodes(NodeOrder.POSTORDER)) {
      if (c.isTheRoot()) {
        continue;
      }
      int cid=treeNodeIds.get(c);
      for (TreeNode p=c.getParent(); !p.isTheRoot(); p=p.getParent()) {
        int pid=treeNodeIds.get(p);
        nestedParents[pid].add(cid);
        nestedChildren[cid].add(pid);
      }
    }
    Tree P=trees.get(i);
    List<TreeNode> pRootChildren=P.getRoot().getChildren();
    for (int j=0; j < trees.size(); j++) {
      if (i == j) {
        continue;
      }
      List<TreeNode> qRootChildren=trees.get(j).getRoot().getChildren();
      boolean treesHaveIdenticalTaxa=original[treeNodeIds.get(pRootChildren.get(0))].hasIdenticalTaxonSetAs(original[treeNodeIds.get(qRootChildren.get(0))]);
      LinkedList<TreeNode> pStack=new LinkedList<TreeNode>();
      for (pStack.addAll(pRootChildren); !pStack.isEmpty(); ) {
        TreeNode p=pStack.pop();
        if (p.isExternal()) {
          continue;
        }
        int pid=treeNodeIds.get(p);
        TLongBipartition bp=original[pid];
        LinkedList<TreeNode> qStack=new LinkedList<TreeNode>();
        for (qStack.addAll(qRootChildren); !qStack.isEmpty(); ) {
          TreeNode q=qStack.pop();
          if (q.isExternal()) {
            continue;
          }
          int qid=treeNodeIds.get(q);
          TLongBipartition bq=original[qid];
          if (bq.isNestedPartitionOf(bp)) {
            nestedParents[qid].add(pid);
            nestedChildren[pid].add(qid);
            if (!treesHaveIdenticalTaxa) {
              nestedAugmentingParents[qid].add(pid);
            }
          }
          if (bq.ingroup().containsAny(bp.ingroup())) {
            for (            TreeNode qc : q.getChildren()) {
              qStack.push(qc);
            }
          }
        }
      }
    }
    for (    TreeNode node : P.internalNodes(NodeOrder.PREORDER)) {
      if (node.isTheRoot()) {
        continue;
      }
      final int child=treeNodeIds.get(node);
      List<Integer> moreParents=summedBipartIds.parallelStream().map(parent -> {
        return bipart[child].isNestedPartitionOf(bipart[parent]) ? parent : null;
      }
).collect(toList()).stream().filter(a -> a != null).collect(toList());
      for (      Integer parent : moreParents) {
        nestedParents[child].add(parent);
        nestedChildren[parent].add(child);
      }
    }
  }
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str");
  paths=new HashSet<Path>();
  System.out.print("String_Node_Str");
  z=new Date().getTime();
  Transaction tx=gdb.beginTx();
  for (int i=0; i < bipart.length; i++) {
    if (bipart[i].outgroup().size() > 0) {
      CompactLongSet pathResult=findPaths(i,new CompactLongSet(),new ArrayList<Integer>(),0,i);
      if (pathResult == null) {
        createNode(bipart[i]);
      }
    }
  }
  tx.success();
  tx.finish();
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str" + paths.size());
  if (VERBOSE) {
    for (    Path p : paths) {
      System.out.println(p);
    }
  }
  System.out.print("String_Node_Str");
  z=new Date().getTime();
  tx=gdb.beginTx();
  for (  Path p : paths) {
    generateNodesFromPaths(0,new CompactLongSet(),p.toArray());
  }
  tx.success();
  tx.finish();
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str");
}