Program: 50163
Project: 50163
Buggy source:
private void createLicaNodesFromBiparts(List<Tree> trees){
  nestedParents=newIntegerSetList(bipart.size());
  nestedChildren=newIntegerSetList(bipart.size());
  nestedAugmentingParents=newIntegerSetList(bipart.size());
  analogousBiparts=newIntegerSetList(bipart.size());
  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.get(cid).add(pid);
        nestedChildren.get(pid).add(cid);
      }
    }
    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.get(qid).add(pid);
            nestedChildren.get(pid).add(qid);
            if (!treesHaveIdenticalTaxa) {
              nestedAugmentingParents.get(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.get(child).isNestedPartitionOf(bipart.get(parent)) ? parent : null;
      }
).collect(toList()).stream().filter(a -> a != null).collect(toList());
      for (      Integer parent : moreParents) {
        nestedParents.get(child).add(parent);
        nestedChildren.get(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.size(); i++) {
    if (bipart.get(i).outgroup().size() > 0) {
      CompactLongSet pathResult=findPaths(i,new CompactLongSet(),new ArrayList<Integer>(),0,i);
      if (pathResult == null) {
        createNode(bipart.get(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=newIntegerSetList(bipart.size());
  nestedChildren=newIntegerSetList(bipart.size());
  nestedAugmentingParents=newIntegerSetList(bipart.size());
  analogousBiparts=newIntegerSetList(bipart.size());
  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.get(cid).add(pid);
        nestedChildren.get(pid).add(cid);
      }
    }
    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.get(qid).add(pid);
            nestedChildren.get(pid).add(qid);
            if (!treesHaveIdenticalTaxa) {
              nestedAugmentingParents.get(qid).add(pid);
            }
          }
          if (bq.ingroup().containsAny(bp.ingroup())) {
            for (            TreeNode qc : q.getChildren()) {
              qStack.push(qc);
            }
          }
        }
        for (        TreeNode qn : qRootChildren) {
          if (bp.ingroup().containsAny(original[treeNodeIds.get(qn)].ingroup())) {
            for (            TreeNode pc : p.getChildren()) {
              pStack.push(pc);
            }
            break;
          }
        }
      }
    }
    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.get(child).isNestedPartitionOf(bipart.get(parent)) ? parent : null;
      }
).collect(toList()).stream().filter(a -> a != null).collect(toList());
      for (      Integer parent : moreParents) {
        nestedParents.get(child).add(parent);
        nestedChildren.get(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.size(); i++) {
    if (bipart.get(i).outgroup().size() > 0) {
      CompactLongSet pathResult=findPaths(i,new CompactLongSet(),new ArrayList<Integer>(),0,i);
      if (pathResult == null) {
        createNode(bipart.get(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");
}