Program: 50112
Project: 50112
Buggy source:
/** 
 * Used to add missing external nodes to the draft tree stored in the graph.
 * @param startNode
 * @param taxRootNode
 */
private void addMissingChildrenToDraftTreewhile(Node startNode,Node taxRootNode){
  String[] supportingSources=new String[1];
  supportingSources[0]="String_Node_Str";
  TLongArrayList taxaleft=new TLongArrayList((long[])startNode.getProperty("String_Node_Str"));
  while (taxaleft.removeAll(knownIdsInTree) == true) {
    continue;
  }
  System.out.println("String_Node_Str" + taxaleft.size());
  while (taxaleft.size() > 0) {
    System.out.print("String_Node_Str" + taxaleft.size());
    long tid=taxaleft.removeAt(0);
    Node taxNode=graphDb.getNodeById(tid);
    System.out.println("String_Node_Str" + ((String)taxNode.getProperty("String_Node_Str")));
    TLongArrayList ttmrca=new TLongArrayList((long[])taxNode.getProperty("String_Node_Str"));
    if (taxNode.hasRelationship(Direction.OUTGOING,RelType.SYNTHCHILDOF)) {
      continue;
    }
    Node ptaxNode=taxNode.getSingleRelationship(RelType.TAXCHILDOF,Direction.OUTGOING).getEndNode();
    ArrayList<Node> nodesInTree=new ArrayList<Node>();
    for (    long cid : (long[])ptaxNode.getProperty("String_Node_Str")) {
      Node childNode=graphDb.getNodeById(cid);
      if (knownIdsInTree.contains(cid)) {
        nodesInTree.add(childNode);
      }
    }
    if (nodesInTree.size() > 1) {
      Node mrca=null;
      mrca=getLICAForDraftTreeNodes(nodesInTree);
      Relationship newRel=taxNode.createRelationshipTo(mrca,RelType.SYNTHCHILDOF);
      synthRelIndex.add(newRel,"String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",supportingSources);
      knownIdsInTree.add(taxNode.getId());
    }
 else {
      Relationship newRel=taxNode.createRelationshipTo(ptaxNode,RelType.SYNTHCHILDOF);
      synthRelIndex.add(newRel,"String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",supportingSources);
      taxaleft.add(ptaxNode.getId());
    }
  }
}

Fixed version (ground truth):
/** 
 * Used to add missing external nodes to the draft tree stored in the graph.
 * @param startNode
 * @param taxRootNode
 */
private void addMissingChildrenToDraftTreewhile(Node startNode,Node taxRootNode){
  String[] supportingSources=new String[1];
  supportingSources[0]="String_Node_Str";
  TLongArrayList taxaleft=new TLongArrayList((long[])startNode.getProperty("String_Node_Str"));
  while (taxaleft.removeAll(knownIdsInTree) == true) {
    continue;
  }
  System.out.println("String_Node_Str" + taxaleft.size());
  while (taxaleft.size() > 0) {
    System.out.print("String_Node_Str" + taxaleft.size());
    long tid=taxaleft.removeAt(0);
    Node taxNode=graphDb.getNodeById(tid);
    System.out.println("String_Node_Str" + ((String)taxNode.getProperty("String_Node_Str")));
    TLongArrayList ttmrca=new TLongArrayList((long[])taxNode.getProperty("String_Node_Str"));
    if (taxNode.hasRelationship(Direction.OUTGOING,RelType.SYNTHCHILDOF)) {
      continue;
    }
    Node ptaxNode=taxNode.getSingleRelationship(RelType.TAXCHILDOF,Direction.OUTGOING).getEndNode();
    ArrayList<Node> nodesInTree=new ArrayList<Node>();
    for (    long cid : (long[])ptaxNode.getProperty("String_Node_Str")) {
      Node childNode=graphDb.getNodeById(cid);
      if (knownIdsInTree.contains(cid)) {
        nodesInTree.add(childNode);
      }
    }
    if (nodesInTree.size() > 1) {
      Node nextAncestorTaxInTree=ptaxNode;
      while (!nextAncestorTaxInTree.hasRelationship(RelType.SYNTHCHILDOF)) {
        nextAncestorTaxInTree=nextAncestorTaxInTree.getSingleRelationship(RelType.TAXCHILDOF,Direction.OUTGOING).getEndNode();
      }
      Relationship newRel=taxNode.createRelationshipTo(nextAncestorTaxInTree,RelType.SYNTHCHILDOF);
      synthRelIndex.add(newRel,"String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",supportingSources);
      knownIdsInTree.add(taxNode.getId());
    }
 else {
      Relationship newRel=taxNode.createRelationshipTo(ptaxNode,RelType.SYNTHCHILDOF);
      synthRelIndex.add(newRel,"String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",DRAFTTREENAME);
      newRel.setProperty("String_Node_Str",supportingSources);
      taxaleft.add(ptaxNode.getId());
    }
  }
}