nus-yam/ex-repair huggingface dataset:
Program: 50154
Project: 50154
Buggy source:
/** 
 * Collect information from trees, including tip labels, nodes that are mapped to those tip labels, original bipartitions from trees, and their original internal nodes. Objects and associated information are stored in various class members for later use.
 * @param trees
 */
private void gatherTreeData(List<Tree> trees){
  System.out.print("String_Node_Str" + trees.size() + "String_Node_Str");
  long z=new Date().getTime();
  if (USING_TAXONOMY) {
    mapTipsToTaxa(trees);
  }
 else {
    importTipsFromTrees(trees);
  }
  nodeId=0;
  for (  Tree tree : trees) {
    Collection<TLongBipartition> treeBiparts=new ArrayList<TLongBipartition>();
    for (    TreeNode node : tree.internalNodes(NodeOrder.PREORDER)) {
      if (!node.isTheRoot()) {
        TLongBipartition b=getGraphBipartForTreeNode(node,tree);
        if (!bipartId.containsKey(b)) {
          bipart.add(b);
          bipartId.put(b,bipart.size() - 1);
        }
 else {
          b=bipart.get(bipartId.get(b));
        }
        if (treeNodesForBipart.get(b) == null) {
          treeNodesForBipart.put(b,new HashSet<TreeNode>());
        }
        treeNodesForBipart.get(b).add(node);
        bipartForTreeNode.put(node,b);
      }
    }
    bipartsByTreeNoDuplicates.add(treeBiparts);
  }
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Collect information from trees, including tip labels, nodes that are mapped to those tip labels, original bipartitions from trees, and their original internal nodes. Objects and associated information are stored in various class members for later use.
 * @param trees
 */
private void gatherTreeData(List<Tree> trees){
  System.out.print("String_Node_Str" + trees.size() + "String_Node_Str");
  long z=new Date().getTime();
  if (USING_TAXONOMY) {
    mapTipsToTaxa(trees);
  }
 else {
    importTipsFromTrees(trees);
  }
  nodeId=0;
  for (  Tree tree : trees) {
    Collection<TLongBipartition> treeBiparts=new ArrayList<TLongBipartition>();
    for (    TreeNode node : tree.internalNodes(NodeOrder.PREORDER)) {
      if (!node.isTheRoot()) {
        TLongBipartition b=getGraphBipartForTreeNode(node,tree);
        if (!bipartId.containsKey(b)) {
          bipart.add(b);
          bipartId.put(b,bipart.size() - 1);
        }
 else {
          b=bipart.get(bipartId.get(b));
        }
        if (treeNodesForBipart.get(b) == null) {
          treeNodesForBipart.put(b,new HashSet<TreeNode>());
        }
        treeNodesForBipart.get(b).add(node);
        bipartForTreeNode.put(node,b);
        if (USING_TAXONOMY) {
          TLongBipartition be=getExpandedTaxonomyBipart(b);
          bipartForTreeNodeExploded.put(node,be);
          if (treeNodesForBipartExploded.get(b) == null) {
            treeNodesForBipartExploded.put(be,new HashSet<TreeNode>());
          }
          treeNodesForBipartExploded.get(be).add(node);
        }
      }
    }
    bipartsByTreeNoDuplicates.add(treeBiparts);
  }
  System.out.println("String_Node_Str" + (new Date().getTime() - z) / (float)1000 + "String_Node_Str");
}
Program: 50157
Project: 50157
Buggy source:
public static void main(String[] args) throws Exception {
  String dbname="String_Node_Str";
  runSimpleTest(nestedOverlap(),dbname);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String dbname="String_Node_Str";
  runSimpleTest(cycleConflictTrees(),dbname);
}
Program: 50160
Project: 50160
Buggy source:
public static void main(String[] args) throws Exception {
  String dbname="String_Node_Str";
  runSimpleTest(trivialConflict(),dbname);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String dbname="String_Node_Str";
  runSimpleTest(conflictingAugmenting(),dbname);
}
Program: 50161
Project: 50161
Buggy source:
/** 
 * Get pairwise sums of all tree biparts and put all biparts into a single array for future use.
 */
private void gatherBipartitions(){
  TLongBipartition[] summed=new BipartSetSum(bipartsByTree).toArray();
  for (int i=0; i < original.length; i++) {
    bipart.add(i,original[i]);
  }
  for (int i=0; i < summed.length; i++) {
    int k=i + original.length;
    bipart.add(k,summed[i]);
    summedBipartIds.add(k);
  }
  System.out.println("String_Node_Str" + original.length + "String_Node_Str"+ summedBipartIds.size()+ "String_Node_Str"+ bipart.size());
}

Fixed version (ground truth):
/** 
 * Get pairwise sums of all tree biparts and put all biparts into a single array for future use.
 */
private void gatherBipartitions(){
  TLongBipartition[] summed=new BipartSetSum(bipartsByTree).toArray();
  for (int i=0; i < original.length; i++) {
    bipart.add(original[i]);
    bipartId.put(original[i],i);
  }
  for (int i=0; i < summed.length; i++) {
    int k=i + original.length;
    bipart.add(summed[i]);
    bipartId.put(summed[i],k);
    summedBipartIds.add(k);
  }
  System.out.println("String_Node_Str" + original.length + "String_Node_Str"+ summedBipartIds.size()+ "String_Node_Str"+ bipart.size());
}
Program: 50162
Project: 50162
Buggy source:
/** 
 * Map all the tree root nodes into the graph. This will create new nodes in the graph for any root nodes that cannot be mapped to preexisting nodes. This *must* be done before loading trees--tree loading uses a preorder traversal.
 * @param trees
 */
private void mapTreeRootNodes(List<Tree> trees){
  for (  Tree tree : trees) {
    Transaction tx=gdb.beginTx();
    TreeNode root=tree.getRoot();
    TLongBipartition rootBipart=getGraphBipartForTreeNode(root,tree);
    HashSet<Node> graphNodes=new HashSet<Node>();
    for (    TLongBipartition b : nodeForBipart.keySet()) {
      if (b.containsAll(rootBipart)) {
        graphNodes.add(nodeForBipart.get(b));
      }
    }
    if (USING_TAXONOMY) {
      for (      Node b : taxonomyGraphNodesMap.keySet()) {
        if (taxonomyGraphNodesMap.get(b).containsAll(rootBipart)) {
          graphNodes.add(b);
        }
      }
      if (VERBOSE) {
        System.out.println(root.getNewick(false) + "String_Node_Str" + graphNodes);
      }
    }
    if (graphNodes.size() < 1) {
      if (VERBOSE) {
        System.out.println("String_Node_Str" + rootBipart);
      }
      graphNodes.add(createNode(rootBipart));
    }
    tx.success();
    tx.finish();
    graphNodesForTreeNode.put(root,graphNodes);
  }
}

Fixed version (ground truth):
/** 
 * Map all the tree root nodes into the graph. This will create new nodes in the graph for any root nodes that cannot be mapped to preexisting nodes. This *must* be done before loading trees--tree loading uses a preorder traversal.
 * @param trees
 */
private void mapTreeRootNodes(List<Tree> trees){
  for (  Tree tree : trees) {
    Transaction tx=gdb.beginTx();
    TreeNode root=tree.getRoot();
    TLongBipartition rootBipart=getGraphBipartForTreeNode(root,tree);
    HashSet<Node> graphNodes=new HashSet<Node>();
    for (    TLongBipartition b : nodeForBipart.keySet()) {
      if (b.containsAll(rootBipart)) {
        graphNodes.add(nodeForBipart.get(b));
      }
    }
    if (USING_TAXONOMY) {
      for (      Node b : taxonomyGraphNodesMap.keySet()) {
        if (taxonomyGraphNodesMap.get(b).containsAll(rootBipart)) {
          graphNodes.add(b);
        }
      }
      if (VERBOSE) {
        System.out.println(root.getNewick(false) + "String_Node_Str" + graphNodes);
      }
    }
    if (graphNodes.size() < 1) {
      if (VERBOSE) {
        System.out.println("String_Node_Str" + rootBipart);
      }
      Node rootNode=createNode(rootBipart);
      graphNodes.add(rootNode);
      for (      TLongBipartition b : nodeForBipart.keySet()) {
        if (rootBipart.isNestedPartitionOf(b)) {
          rootNode.createRelationshipTo(nodeForBipart.get(b),RelType.MRCACHILDOF);
        }
        if (b.isNestedPartitionOf(rootBipart)) {
          nodeForBipart.get(b).createRelationshipTo(rootNode,RelType.MRCACHILDOF);
        }
      }
    }
    tx.success();
    tx.finish();
    graphNodesForTreeNode.put(root,graphNodes);
  }
}
Program: 50165
Project: 50165
Buggy source:
private BitMask getBitMask(BitMask mask){
  if (mask.size() > MAX_LONG_BITMASK_SIZE) {
    return new BitSetMask((BitSetMask)mask);
  }
 else {
    return new IntegerBitMask((IntegerBitMask)mask);
  }
}

Fixed version (ground truth):
private BitMask getBitMask(BitMask mask){
  if (mask.size() > MAX_LONG_BITMASK_SIZE) {
    return new BitSetMask((BitSetMask)mask);
  }
 else {
    return new LongBitMask((LongBitMask)mask);
  }
}
Program: 50166
Project: 50166
Buggy source:
private BitMask getEmptyBitMask(int size){
  if (size > MAX_LONG_BITMASK_SIZE) {
    return new BitSetMask(size);
  }
 else {
    return new IntegerBitMask(size);
  }
}

Fixed version (ground truth):
private BitMask getEmptyBitMask(int size){
  if (size > MAX_LONG_BITMASK_SIZE) {
    return new BitSetMask(size);
  }
 else {
    return new LongBitMask(size);
  }
}
Program: 50167
Project: 50167
Buggy source:
private static void simpleTest(){
  Long[] ids=new Long[]{44L,40L,1L};
  TLongBitArraySet a=new TLongBitArraySet();
  a.addAll(new int[]{7});
  TLongBitArraySet b=new TLongBitArraySet();
  b.addAll(new int[]{3});
  TLongBitArraySet c=new TLongBitArraySet();
  c.addAll(new int[]{1,2,4,5,6});
  TLongBitArraySet d=new TLongBitArraySet();
  d.addAll(new int[]{2,3,4,5,6,7});
  TLongBitArraySet[] descendants=new TLongBitArraySet[]{a,b,c};
  BruteWeightedIS B=new BruteWeightedIS(ids,descendants);
  System.out.println("String_Node_Str");
  printBest(B);
}

Fixed version (ground truth):
private static void simpleTest(){
  Long[] ids=new Long[]{44L,40L,1L};
  TLongBitArraySet a=new TLongBitArraySet();
  a.addAll(new int[]{7});
  TLongBitArraySet b=new TLongBitArraySet();
  b.addAll(new int[]{3});
  TLongBitArraySet c=new TLongBitArraySet();
  c.addAll(new int[]{1,2,4,5,6});
  TLongBitArraySet d=new TLongBitArraySet();
  d.addAll(new int[]{2,3,4,5,6,7});
  TLongBitArraySet[] descendants=new TLongBitArraySet[]{a,b,c};
  BruteWeightedIS B=new BruteWeightedIS(ids,descendants);
  Long[] e=new Long[]{44L,40L,1L};
  System.out.println("String_Node_Str" + Arrays.toString(e));
  System.out.println("String_Node_Str" + Arrays.toString(B.best()));
}
Program: 50168
Project: 50168
Buggy source:
private static void arbitrarySizeRandomTest(int numberOfSets){
  int setSize=10;
  int maxItemValue=1000;
  System.out.println("String_Node_Str" + Math.pow(2,numberOfSets));
  Long[] ids=new Long[numberOfSets];
  for (int i=0; i < numberOfSets; i++) {
    ids[i]=(long)i;
  }
  TLongBitArraySet[] descendants=new TLongBitArraySet[ids.length];
  for (int i=0; i < ids.length; i++) {
    TLongBitArraySet a=new TLongBitArraySet();
    for (int j=0; j < setSize; j++) {
      a.add(randomInt(maxItemValue));
    }
    descendants[i]=a;
  }
  BruteWeightedIS B=new BruteWeightedIS(ids,descendants);
  printBest(B);
}

Fixed version (ground truth):
private static void arbitrarySizeRandomTest(int numberOfSets){
  int setSize=10;
  int maxItemValue=1000;
  System.out.println("String_Node_Str" + Math.pow(2,numberOfSets));
  Long[] ids=new Long[numberOfSets];
  for (int i=0; i < numberOfSets; i++) {
    ids[i]=(long)i;
  }
  TLongBitArraySet[] descendants=new TLongBitArraySet[ids.length];
  for (int i=0; i < ids.length; i++) {
    TLongBitArraySet a=new TLongBitArraySet();
    for (int j=0; j < setSize; j++) {
      a.add(randomInt(maxItemValue));
    }
    descendants[i]=a;
  }
  BruteWeightedIS B=new BruteWeightedIS(ids,descendants);
  System.out.println("String_Node_Str" + Arrays.toString(B.best()));
}
Program: 50169
Project: 50169
Buggy source:
public BruteWeightedIS(Long[] ids,TLongBitArraySet[] descendants){
  MAX_LONG_BITMASK_SIZE=new IntegerBitMask(0).maxSize();
  MAX_BITSET_MASK_SIZE=new BitSetMask(0).maxSize();
  this.ids=ids;
  this.descendants=descendants;
  System.out.println("String_Node_Str");
  System.out.println(this);
  findBestSet();
}

Fixed version (ground truth):
public BruteWeightedIS(Long[] ids,TLongBitArraySet[] descendants){
  MAX_LONG_BITMASK_SIZE=new LongBitMask(0).maxSize();
  MAX_BITSET_MASK_SIZE=new BitSetMask(0).maxSize();
  this.ids=ids;
  this.descendants=descendants;
  System.out.println("String_Node_Str");
  System.out.println(this);
  findBestSet();
}
Program: 50170
Project: 50170
Buggy source:
public Node getTaxonomyMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  mrca=holder.get(index);
  return mrca;
}

Fixed version (ground truth):
public Node getTaxonomyMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  if (!holder.isEmpty()) {
    if (index == 10000000) {
      mrca=holder.get(0);
    }
 else {
      mrca=holder.get(index);
    }
  }
  return mrca;
}
Program: 50171
Project: 50171
Buggy source:
public Node getDraftTreeMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  mrca=holder.get(index);
  return mrca;
}

Fixed version (ground truth):
public Node getDraftTreeMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  if (!holder.isEmpty()) {
    if (index == 10000000) {
      mrca=holder.get(0);
    }
 else {
      mrca=holder.get(index);
    }
  }
  return mrca;
}
Program: 50172
Project: 50172
Buggy source:
public Node getTaxonomyMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  if (!holder.isEmpty()) {
    if (index == 10000000) {
      mrca=holder.get(0);
    }
 else {
      mrca=holder.get(index);
    }
  }
  return mrca;
}

Fixed version (ground truth):
public Node getTaxonomyMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().relationships(RelType.TAXCHILDOF,Direction.OUTGOING).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  if (!holder.isEmpty()) {
    if (index == 10000000) {
      mrca=holder.get(holder.size() - 1);
    }
 else {
      mrca=holder.get(index);
    }
  }
  return mrca;
}
Program: 50173
Project: 50173
Buggy source:
public Node getDraftTreeMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  if (!holder.isEmpty()) {
    if (index == 10000000) {
      mrca=holder.get(0);
    }
 else {
      mrca=holder.get(index);
    }
  }
  return mrca;
}

Fixed version (ground truth):
public Node getDraftTreeMRCA(Iterable<Node> nodeset){
  Node mrca=null;
  ArrayList<Node> holder=null;
  int index=10000000;
  for (  Node curNode : nodeset) {
    if (holder != null) {
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        int foo=holder.indexOf(m);
        if (foo != -1) {
          if (foo < index) {
            index=foo;
          }
          break;
        }
      }
    }
 else {
      ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
      for (      Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curNode).nodes()) {
        graphPathToRoot.add(0,m);
      }
      holder=graphPathToRoot;
    }
  }
  if (!holder.isEmpty()) {
    if (index == 10000000) {
      mrca=holder.get(holder.size() - 1);
    }
 else {
      mrca=holder.get(index);
    }
  }
  return mrca;
}
Program: 50174
Project: 50174
Buggy source:
public static HashMap<String,Object> reformatSourceID(String source){
  HashMap<String,Object> results=new HashMap<String,Object>();
  String[] res=source.split("String_Node_Str");
  String studyId="String_Node_Str";
  String treeId="String_Node_Str";
  String gitSha="String_Node_Str";
  if (res.length == 4) {
    studyId=res[0] + "String_Node_Str" + res[1];
    treeId=res[2];
    gitSha=res[3];
  }
 else   if (res.length == 4) {
    studyId=res[0];
    treeId=res[1];
    gitSha=res[2];
  }
 else {
    studyId=res[0];
  }
  results.put("String_Node_Str",studyId);
  results.put("String_Node_Str",treeId);
  results.put("String_Node_Str",gitSha);
  return (results);
}

Fixed version (ground truth):
public static HashMap<String,Object> reformatSourceID(String source){
  HashMap<String,Object> results=new HashMap<String,Object>();
  String[] res=source.split("String_Node_Str");
  String studyId="String_Node_Str";
  String treeId="String_Node_Str";
  String gitSha="String_Node_Str";
  if (res.length == 4) {
    studyId=res[0] + "String_Node_Str" + res[1];
    treeId=res[2];
    gitSha=res[3];
  }
 else   if (res.length == 3) {
    studyId=res[0];
    treeId=res[1];
    gitSha=res[2];
  }
 else   if (res.length == 2) {
    studyId=res[0];
    treeId=res[1];
  }
 else {
    studyId=res[0];
  }
  results.put("String_Node_Str",studyId);
  results.put("String_Node_Str",treeId);
  results.put("String_Node_Str",gitSha);
  return (results);
}
Program: 50178
Project: 50178
Buggy source:
/** 
 * Internal method to get an array of arrays representing the rootward paths of a given set of nodes, used to calculate mrca and associated procedures.
 * @param tips
 * @return
 */
private Map<Node,ArrayList<Node>> getTreeTipRootPathMap(Iterable<Node> tips){
  HashMap<Node,ArrayList<Node>> treeTipRootPathMap=new HashMap<Node,ArrayList<Node>>();
  for (  Node curTip : tips) {
    System.out.println("String_Node_Str" + curTip + (curTip.hasProperty("String_Node_Str") ? curTip.getProperty("String_Node_Str") : "String_Node_Str"));
    ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
    for (    Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curTip).nodes()) {
      if (m.hasProperty("String_Node_Str")) {
        System.out.println(m.getProperty("String_Node_Str"));
      }
      graphPathToRoot.add(0,m);
    }
    if (graphPathToRoot.size() < 1) {
      throw new UnsupportedOperationException("String_Node_Str" + curTip + "String_Node_Str");
    }
    treeTipRootPathMap.put(curTip,graphPathToRoot);
  }
  return treeTipRootPathMap;
}

Fixed version (ground truth):
/** 
 * Internal method to get an array of arrays representing the rootward paths of a given set of nodes, used to calculate mrca and associated procedures. stopNode allows to set an mrca beyond which the traversal won't record the path.
 * @param tips
 * @param stopNode
 * @return
 */
private Map<Node,ArrayList<Node>> getTreeTipRootPathMap(Iterable<Node> tips,Node stopNode){
  if (stopNode != null) {
    System.out.println("String_Node_Str" + stopNode);
  }
  HashMap<Node,ArrayList<Node>> treeTipRootPathMap=new HashMap<Node,ArrayList<Node>>();
  for (  Node curTip : tips) {
    System.out.println("String_Node_Str" + curTip + (curTip.hasProperty("String_Node_Str") ? curTip.getProperty("String_Node_Str") : "String_Node_Str"));
    ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
    for (    Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curTip).nodes()) {
      if (stopNode != null && m.equals(stopNode)) {
        System.out.println("String_Node_Str" + stopNode);
        break;
      }
      if (m.hasProperty("String_Node_Str")) {
        System.out.println(m.getProperty("String_Node_Str"));
      }
      graphPathToRoot.add(0,m);
    }
    if (graphPathToRoot.size() < 1) {
      throw new UnsupportedOperationException("String_Node_Str" + curTip + "String_Node_Str");
    }
    treeTipRootPathMap.put(curTip,graphPathToRoot);
  }
  return treeTipRootPathMap;
}
Program: 50182
Project: 50182
Buggy source:
/** 
 * Internal method to get an array of arrays representing the rootward paths of a given set of nodes, used to calculate mrca and associated procedures. stopNode allows to set an mrca beyond which the traversal won't record the path.
 * @param tips
 * @param stopNode
 * @return
 */
private Map<Node,ArrayList<Node>> getTreeTipRootPathMap(Iterable<Node> tips,Node stopNode){
  if (stopNode != null) {
    System.out.println("String_Node_Str" + stopNode);
  }
  HashMap<Node,ArrayList<Node>> treeTipRootPathMap=new HashMap<Node,ArrayList<Node>>();
  for (  Node curTip : tips) {
    System.out.println("String_Node_Str" + curTip + (curTip.hasProperty("String_Node_Str") ? curTip.getProperty("String_Node_Str") : "String_Node_Str"));
    ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
    for (    Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curTip).nodes()) {
      if (stopNode != null && m.equals(stopNode)) {
        System.out.println("String_Node_Str" + stopNode);
        break;
      }
      if (m.hasProperty("String_Node_Str")) {
        System.out.println(m.getProperty("String_Node_Str"));
      }
      graphPathToRoot.add(0,m);
    }
    if (graphPathToRoot.size() < 1) {
      throw new UnsupportedOperationException("String_Node_Str" + curTip + "String_Node_Str");
    }
    treeTipRootPathMap.put(curTip,graphPathToRoot);
  }
  return treeTipRootPathMap;
}

Fixed version (ground truth):
/** 
 * Internal method to get an array of arrays representing the rootward paths of a given set of nodes, used to calculate mrca and associated procedures. stopNode allows to set an mrca beyond which the traversal won't record the path.
 * @param tips
 * @param stopNode
 * @return
 */
private Map<Node,ArrayList<Node>> getTreeTipRootPathMap(Iterable<Node> tips,Node stopNode){
  if (stopNode != null) {
    System.out.println("String_Node_Str" + stopNode);
  }
  HashMap<Node,ArrayList<Node>> treeTipRootPathMap=new HashMap<Node,ArrayList<Node>>();
  for (  Node curTip : tips) {
    ArrayList<Node> graphPathToRoot=new ArrayList<Node>();
    for (    Node m : Traversal.description().expand(new DraftTreePathExpander(Direction.OUTGOING)).traverse(curTip).nodes()) {
      if (stopNode != null && m.equals(stopNode)) {
        break;
      }
      graphPathToRoot.add(0,m);
    }
    if (graphPathToRoot.size() < 1) {
      throw new UnsupportedOperationException("String_Node_Str" + curTip + "String_Node_Str");
    }
    treeTipRootPathMap.put(curTip,graphPathToRoot);
  }
  return treeTipRootPathMap;
}
Program: 50184
Project: 50184
Buggy source:
public int extractDraftSubTreeForNodeIDs(String[] args) throws MultipleHitsException {
  if (args.length != 4) {
    System.out.println("String_Node_Str");
    return 1;
  }
  System.out.println(args[1]);
  String[] nodeIds=args[1].trim().split("String_Node_Str");
  String outFileName=args[2];
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  ArrayList<Node> tipNodes=new ArrayList<Node>();
  for (  String nodeId : nodeIds) {
    System.out.println(nodeId);
    Node tip=ge.graphDb.getNodeById(Long.valueOf(nodeId));
    if (tip != null) {
      System.out.println("String_Node_Str" + tip.getId());
      tipNodes.add(tip);
    }
  }
  JadeNode synthTreeRootNode=ge.extractDraftSubtreeForTipNodes(tipNodes);
  PrintWriter outFile=null;
  try {
    outFile=new PrintWriter(new FileWriter(outFileName));
    outFile.write(synthTreeRootNode.getNewick(true) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    outFile.close();
    ge.shutdownDB();
  }
  return 0;
}

Fixed version (ground truth):
public int extractDraftSubTreeForNodeIDs(String[] args) throws MultipleHitsException {
  if (args.length != 4) {
    System.out.println("String_Node_Str");
    return 1;
  }
  String[] nodeIds=args[1].trim().split("String_Node_Str");
  String outFileName=args[2];
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  ArrayList<Node> tipNodes=new ArrayList<Node>();
  for (  String nodeId : nodeIds) {
    Node tip=ge.graphDb.getNodeById(Long.valueOf(nodeId));
    if (tip != null) {
      tipNodes.add(tip);
    }
  }
  JadeNode synthTreeRootNode=ge.extractDraftSubtreeForTipNodes(tipNodes);
  PrintWriter outFile=null;
  try {
    outFile=new PrintWriter(new FileWriter(outFileName));
    outFile.write(synthTreeRootNode.getNewick(true) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    outFile.close();
    ge.shutdownDB();
  }
  return 0;
}
Program: 50185
Project: 50185
Buggy source:
public int extractDraftSubTreeForOttIDs(String[] args) throws OttIdNotFoundException, MultipleHitsException, TaxonNotFoundException {
  if (args.length != 4) {
    System.out.println("String_Node_Str");
    return 1;
  }
  System.out.println(args[1]);
  String[] OTTids=args[1].trim().split("String_Node_Str");
  String outFileName=args[2];
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  ArrayList<Node> tipNodes=new ArrayList<Node>();
  for (  String OTTid : OTTids) {
    System.out.println(OTTid);
    Node tip=ge.findGraphTaxNodeByUID(OTTid);
    if (tip != null) {
      System.out.println("String_Node_Str" + tip.getId());
      tipNodes.add(tip);
    }
  }
  JadeNode synthTreeRootNode=ge.extractDraftSubtreeForTipNodes(tipNodes);
  PrintWriter outFile=null;
  try {
    outFile=new PrintWriter(new FileWriter(outFileName));
    outFile.write(synthTreeRootNode.getNewick(true) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    outFile.close();
    ge.shutdownDB();
  }
  return 0;
}

Fixed version (ground truth):
public int extractDraftSubTreeForOttIDs(String[] args) throws OttIdNotFoundException, MultipleHitsException, TaxonNotFoundException {
  if (args.length != 4) {
    System.out.println("String_Node_Str");
    return 1;
  }
  String[] OTTids=args[1].trim().split("String_Node_Str");
  String outFileName=args[2];
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  ArrayList<Node> tipNodes=new ArrayList<Node>();
  for (  String OTTid : OTTids) {
    Node tip=ge.findGraphTaxNodeByUID(OTTid);
    if (tip != null) {
      tipNodes.add(tip);
    }
  }
  JadeNode synthTreeRootNode=ge.extractDraftSubtreeForTipNodes(tipNodes);
  PrintWriter outFile=null;
  try {
    outFile=new PrintWriter(new FileWriter(outFileName));
    outFile.write(synthTreeRootNode.getNewick(true) + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    outFile.close();
    ge.shutdownDB();
  }
  return 0;
}
Program: 50186
Project: 50186
Buggy source:
@Description("String_Node_Str" + "String_Node_Str") @PluginTarget(GraphDatabaseService.class) public Representation getDraftTreeSubtreeForNodes(@Source GraphDatabaseService graphDb,@Description("String_Node_Str") @Parameter(name="String_Node_Str",optional=true) long[] nodeIds,@Description("String_Node_Str") @Parameter(name="String_Node_Str",optional=true) long[] ottIds) throws MultipleHitsException, TaxonNotFoundException {
  if (nodeIds.length < 1 && ottIds.length < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayList<Node> tips=new ArrayList<Node>();
  GraphExplorer ge=new GraphExplorer(graphDb);
  if (nodeIds != null && nodeIds.length > 0) {
    for (    long nodeId : nodeIds) {
      Node n=graphDb.getNodeById(nodeId);
      if (n != null) {
        tips.add(n);
      }
    }
  }
  if (ottIds != null && ottIds.length > 0) {
    for (    long ottId : ottIds) {
      Node n=ge.findGraphTaxNodeByUID(String.valueOf(ottId));
      if (n != null) {
        tips.add(n);
      }
    }
  }
  if (tips.size() < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else {
    HashMap<String,Object> vals=new HashMap<String,Object>();
    vals.put("String_Node_Str",tips);
    vals.put("String_Node_Str",ge.extractDraftSubtreeForTipNodes(tips).getNewick(true) + "String_Node_Str");
    return OTRepresentationConverter.convert(vals);
  }
}

Fixed version (ground truth):
@Description("String_Node_Str" + "String_Node_Str") @PluginTarget(GraphDatabaseService.class) public Representation getDraftTreeSubtreeForNodes(@Source GraphDatabaseService graphDb,@Description("String_Node_Str") @Parameter(name="String_Node_Str",optional=true) long[] nodeIds,@Description("String_Node_Str") @Parameter(name="String_Node_Str",optional=true) long[] ottIds) throws MultipleHitsException, TaxonNotFoundException {
  if ((nodeIds == null || nodeIds.length < 1) && (ottIds == null || ottIds.length < 1)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayList<Node> tips=new ArrayList<Node>();
  GraphExplorer ge=new GraphExplorer(graphDb);
  if (nodeIds != null && nodeIds.length > 0) {
    for (    long nodeId : nodeIds) {
      Node n=graphDb.getNodeById(nodeId);
      if (n != null) {
        tips.add(n);
      }
    }
  }
  if (ottIds != null && ottIds.length > 0) {
    for (    long ottId : ottIds) {
      Node n=ge.findGraphTaxNodeByUID(String.valueOf(ottId));
      if (n != null) {
        tips.add(n);
      }
    }
  }
  if (tips.size() < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else {
    HashMap<String,Object> vals=new HashMap<String,Object>();
    vals.put("String_Node_Str",tips);
    vals.put("String_Node_Str",ge.extractDraftSubtreeForTipNodes(tips).getNewick(true) + "String_Node_Str");
    return OTRepresentationConverter.convert(vals);
  }
}
Program: 50188
Project: 50188
Buggy source:
@Description("String_Node_Str") @PluginTarget(GraphDatabaseService.class) public Representation getDraftTreeID(@Source GraphDatabaseService graphDb,@Description("String_Node_Str") @Parameter(name="String_Node_Str",optional=true) String startingTaxonOTTId) throws TaxonNotFoundException, MultipleHitsException {
  GraphExplorer ge=new GraphExplorer(graphDb);
  HashMap<String,Object> draftTreeInfo=null;
  Node startNode=null;
  try {
    if (startingTaxonOTTId == null || startingTaxonOTTId.length() == 0) {
      startNode=ge.getGraphRootNode();
    }
 else {
      startNode=ge.findGraphTaxNodeByUID(startingTaxonOTTId);
    }
    draftTreeInfo=new HashMap<String,Object>();
    draftTreeInfo.put("String_Node_Str",GraphBase.DRAFTTREENAME);
    draftTreeInfo.put("String_Node_Str",String.valueOf(startNode.getProperty(NodeProperty.NAME.propertyName)));
    draftTreeInfo.put("String_Node_Str",(Long)startNode.getProperty(NodeProperty.TAX_UID.propertyName));
    draftTreeInfo.put("String_Node_Str",startNode.getId());
  }
  finally {
    ge.shutdownDB();
  }
  return OpenTreeMachineRepresentationConverter.convert(draftTreeInfo);
}

Fixed version (ground truth):
@Description("String_Node_Str") @PluginTarget(GraphDatabaseService.class) public Representation getDraftTreeID(@Source GraphDatabaseService graphDb,@Description("String_Node_Str") @Parameter(name="String_Node_Str",optional=true) String startingTaxonOTTId) throws TaxonNotFoundException, MultipleHitsException {
  GraphExplorer ge=new GraphExplorer(graphDb);
  HashMap<String,Object> draftTreeInfo=null;
  Node startNode=null;
  try {
    if (startingTaxonOTTId == null || startingTaxonOTTId.length() == 0) {
      startNode=ge.getGraphRootNode();
    }
 else {
      startNode=ge.findGraphTaxNodeByUID(startingTaxonOTTId);
    }
    draftTreeInfo=new HashMap<String,Object>();
    draftTreeInfo.put("String_Node_Str",GraphBase.DRAFTTREENAME);
    draftTreeInfo.put("String_Node_Str",String.valueOf(startNode.getProperty(NodeProperty.NAME.propertyName)));
    draftTreeInfo.put("String_Node_Str",Long.valueOf((String)startNode.getProperty(NodeProperty.TAX_UID.propertyName)));
    draftTreeInfo.put("String_Node_Str",startNode.getId());
  }
  finally {
    ge.shutdownDB();
  }
  return OpenTreeMachineRepresentationConverter.convert(draftTreeInfo);
}
Program: 50191
Project: 50191
Buggy source:
/** 
 * This will get the list of studies that have been updated in phylografter since a particular date and to another date The resulting list of ids can then be fetched using the fetchTreesFromStudy
 * @param datefrom should be like 2010-01-01
 * @param dateto should be like 2013-03-19
 * @return list of study ids
 */
public static ArrayList<Long> getUpdateStudyList(String datefrom,String dateto){
  String urlbase="String_Node_Str" + datefrom + "String_Node_Str"+ dateto+ "String_Node_Str";
  System.out.println("String_Node_Str" + urlbase);
  try {
    URL phurl=new URL(urlbase);
    URLConnection conn=phurl.openConnection();
    conn.connect();
    BufferedReader un=new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String inl;
    JSONObject all=(JSONObject)JSONValue.parse(un);
    JSONArray root=(JSONArray)all.get("String_Node_Str");
    ArrayList<Long> stids=new ArrayList<Long>();
    for (    Object id : root) {
      Long j=(Long)id;
      stids.add(j);
    }
    return stids;
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This will get the list of studies that have been updated in phylografter since a particular date and to another date The resulting list of ids can then be fetched using the fetchTreesFromStudy
 * @param datefrom should be like 2010-01-01
 * @param dateto should be like 2013-03-19
 * @return list of study ids
 */
public static ArrayList<Long> getUpdateStudyList(String datefrom,String dateto){
  String urlbase="String_Node_Str" + datefrom + "String_Node_Str"+ dateto+ "String_Node_Str";
  System.out.println("String_Node_Str" + urlbase);
  try {
    URL phurl=new URL(urlbase);
    URLConnection conn=phurl.openConnection();
    conn.connect();
    BufferedReader un=new BufferedReader(new InputStreamReader(conn.getInputStream()));
    JSONObject all=(JSONObject)JSONValue.parse(un);
    JSONArray root=(JSONArray)all.get("String_Node_Str");
    ArrayList<Long> stids=new ArrayList<Long>();
    for (    Object id : root) {
      Long j=(Long)id;
      stids.add(j);
    }
    return stids;
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 50193
Project: 50193
Buggy source:
public int synthesizeDraftTreeWithListForTaxUID(String[] args) throws Exception {
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  String ottolId=args[1];
  String startNodeIdStr=String.valueOf(ge.findGraphTaxNodeByUID(ottolId).getId());
  args[1]=startNodeIdStr;
  return synthesizeDraftTreeWithListForNodeId(args);
}

Fixed version (ground truth):
public int synthesizeDraftTreeWithListForTaxUID(String[] args) throws Exception {
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  String ottolId=args[1];
  String startNodeIdStr=String.valueOf(ge.findGraphTaxNodeByUID(ottolId).getId());
  args[1]=startNodeIdStr;
  ge.shutdownDB();
  return synthesizeDraftTreeWithListForNodeId(args);
}
Program: 50194
Project: 50194
Buggy source:
public int extractDraftTreeForOttId(String[] args) throws OttolIdNotFoundException, MultipleHitsException, TaxonNotFoundException {
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  String ottolId=args[1];
  String startNodeIdStr=String.valueOf(ge.findGraphTaxNodeByUID(ottolId).getId());
  args[1]=startNodeIdStr;
  return extractDraftTreeForNodeId(args);
}

Fixed version (ground truth):
public int extractDraftTreeForOttId(String[] args) throws OttolIdNotFoundException, MultipleHitsException, TaxonNotFoundException {
  String graphname=args[3];
  GraphExplorer ge=new GraphExplorer(graphname);
  String ottolId=args[1];
  String startNodeIdStr=String.valueOf(ge.findGraphTaxNodeByUID(ottolId).getId());
  args[1]=startNodeIdStr;
  ge.shutdownDB();
  return extractDraftTreeForNodeId(args);
}
Program: 50198
Project: 50198
Buggy source:
public int synthesizeDraftTreeWithList(String[] args) throws OttolIdNotFoundException, MultipleHitsException, TaxonNotFoundException {
  boolean test=false;
  if (args.length != 4 && args.length != 5) {
    System.out.println("String_Node_Str");
    return 1;
  }
  if (args.length == 5) {
    System.out.println("String_Node_Str");
    test=true;
  }
  String ottolId=args[1];
  String slist=args[2];
  String graphname=args[3];
  boolean success=false;
  GraphExplorer ge=new GraphExplorer(graphname);
  try {
    LinkedList<String> preferredSources=new LinkedList<String>();
    String[] tsl=slist.split("String_Node_Str");
    for (int i=0; i < tsl.length; i++) {
      preferredSources.add(tsl[i]);
    }
    System.out.println(preferredSources);
    Node firstNode=ge.findGraphTaxNodeByUID(ottolId);
    if (firstNode == null) {
      throw new opentree.exceptions.OttolIdNotFoundException(ottolId);
    }
    success=ge.synthesizeAndStoreDraftTreeBranches(firstNode,preferredSources,test);
    System.out.println("String_Node_Str");
  }
 catch (  OttolIdNotFoundException oex) {
    oex.printStackTrace();
  }
 finally {
    ge.shutdownDB();
  }
  return (success ? 0 : -1);
}

Fixed version (ground truth):
public int synthesizeDraftTreeWithList(String[] args) throws Exception {
  boolean test=false;
  if (args.length != 4 && args.length != 5) {
    System.out.println("String_Node_Str");
    return 1;
  }
  if (args.length == 5) {
    System.out.println("String_Node_Str");
    test=true;
  }
  String ottolId=args[1];
  String slist=args[2];
  String graphname=args[3];
  boolean success=false;
  GraphExplorer ge=new GraphExplorer(graphname);
  try {
    LinkedList<String> preferredSources=new LinkedList<String>();
    String[] tsl=slist.split("String_Node_Str");
    for (int i=0; i < tsl.length; i++) {
      preferredSources.add(tsl[i]);
    }
    System.out.println(preferredSources);
    Node firstNode=ge.findGraphTaxNodeByUID(ottolId);
    if (firstNode == null) {
      throw new opentree.exceptions.OttolIdNotFoundException(ottolId);
    }
    success=ge.synthesizeAndStoreDraftTreeBranches(firstNode,preferredSources,test);
    System.out.println("String_Node_Str");
  }
 catch (  OttolIdNotFoundException oex) {
    oex.printStackTrace();
  }
 finally {
    ge.shutdownDB();
  }
  return (success ? 0 : -1);
}
Program: 50199
Project: 50199
Buggy source:
public int synthesizeDraftTree(String[] args) throws OttolIdNotFoundException, MultipleHitsException, TaxonNotFoundException {
  boolean test=false;
  if (args.length != 3) {
    System.out.println("String_Node_Str");
    return 1;
  }
  String ottolId=args[1];
  String graphname=args[2];
  boolean success=false;
  GraphExplorer ge=new GraphExplorer(graphname);
  try {
    LinkedList<String> preferredSources=new LinkedList<String>();
    preferredSources.add("String_Node_Str");
    preferredSources.add("String_Node_Str");
    Node firstNode=ge.findGraphTaxNodeByUID(ottolId);
    if (firstNode == null) {
      throw new opentree.exceptions.OttolIdNotFoundException(ottolId);
    }
    success=ge.synthesizeAndStoreDraftTreeBranches(firstNode,preferredSources,test);
  }
 catch (  OttolIdNotFoundException oex) {
    oex.printStackTrace();
  }
 finally {
    ge.shutdownDB();
  }
  return (success ? 0 : -1);
}

Fixed version (ground truth):
public int synthesizeDraftTree(String[] args) throws Exception {
  boolean test=false;
  if (args.length != 3) {
    System.out.println("String_Node_Str");
    return 1;
  }
  String ottolId=args[1];
  String graphname=args[2];
  boolean success=false;
  GraphExplorer ge=new GraphExplorer(graphname);
  try {
    LinkedList<String> preferredSources=new LinkedList<String>();
    preferredSources.add("String_Node_Str");
    preferredSources.add("String_Node_Str");
    Node firstNode=ge.findGraphTaxNodeByUID(ottolId);
    if (firstNode == null) {
      throw new opentree.exceptions.OttolIdNotFoundException(ottolId);
    }
    success=ge.synthesizeAndStoreDraftTreeBranches(firstNode,preferredSources,test);
  }
 catch (  OttolIdNotFoundException oex) {
    oex.printStackTrace();
  }
 finally {
    ge.shutdownDB();
  }
  return (success ? 0 : -1);
}
Program: 50200
Project: 50200
Buggy source:
/** 
 * Ingest the current JadeTree (in the jt data member) to the GoL. this should be done as a preorder traversal
 * @param focalgroup a taxonomic name of the ancestor of the leaves in the treethis is only used in disambiguating taxa when there are multiple hits  for a leaf's taxonomic name
 * @param sourcename the name to be registered as the "source" property forevery edge in this tree.
 * @throws TaxonNotFoundException 
 * @throws MultipleHitsException 
 * @todo we probably want a node in the graph representing the tree with an ISROOTOF edge from its root to the tree. We could attach annotations about the tree to this node. We have the index of the root node, but need to having and isroot would also be helpful. Unless we are indexing this we could just randomly choose one of the edges that is connected to the root node that is in the index
 */
public void addSetTreeToGraph(String focalgroup,String sourceName,boolean allTreesHaveAllTaxa,MessageLogger msgLogger) throws TreeIngestException, MultipleHitsException, TaxonNotFoundException {
  this.runTestOnly=false;
  this.allTreesHaveAllTaxa=allTreesHaveAllTaxa;
  this.logger=msgLogger;
  this.sourceName=sourceName;
  matchTaxaUsingNames(focalgroup);
  loadTree();
}

Fixed version (ground truth):
/** 
 * Ingest the current JadeTree (in the jt data member) to the GoL. this should be done as a preorder traversal
 * @param focalgroup a taxonomic name of the ancestor of the leaves in the treethis is only used in disambiguating taxa when there are multiple hits  for a leaf's taxonomic name
 * @param sourcename the name to be registered as the "source" property forevery edge in this tree.
 * @throws TaxonNotFoundException 
 * @throws MultipleHitsException 
 * @todo we probably want a node in the graph representing the tree with an ISROOTOF edge from its root to the tree. We could attach annotations about the tree to this node. We have the index of the root node, but need to having and isroot would also be helpful. Unless we are indexing this we could just randomly choose one of the edges that is connected to the root node that is in the index
 */
public void addSetTreeToGraph(String focalgroup,String sourceName,boolean allTreesHaveAllTaxa,MessageLogger msgLogger) throws TreeIngestException, MultipleHitsException, TaxonNotFoundException {
  this.runTestOnly=false;
  this.allTreesHaveAllTaxa=allTreesHaveAllTaxa;
  this.logger=msgLogger;
  this.sourceName=sourceName;
  matchTaxaUsingNames(focalgroup);
  loadTree();
  remapInputLeavesToDeepestTaxa();
}
Program: 50201
Project: 50201
Buggy source:
/** 
 * Ingest the current JadeTree (in the inputTree instance variable) to the GoL. This will assume that the JadeNodes all have a property set as ot:ottolid that will be the preset ottol id identifier that will be found by index. ALL THE NAMES HAVE TO BE SET FOR THIS FUNCTION
 * @param sourcename the name to be registered as the "source" property for every edge in this tree.
 * @param test don't add to the database
 */
public void addSetTreeToGraphWIdsSet(String sourceName,boolean allTreesHaveAllTaxa,boolean runTestOnly,MessageLogger msgLogger) throws TaxonNotFoundException, TreeIngestException {
  this.runTestOnly=runTestOnly;
  this.allTreesHaveAllTaxa=allTreesHaveAllTaxa;
  this.logger=msgLogger;
  this.sourceName=sourceName;
  matchTaxaUsingTaxUIDs();
  loadTree();
}

Fixed version (ground truth):
/** 
 * Ingest the current JadeTree (in the inputTree instance variable) to the GoL. This will assume that the JadeNodes all have a property set as ot:ottolid that will be the preset ottol id identifier that will be found by index. ALL THE NAMES HAVE TO BE SET FOR THIS FUNCTION
 * @param sourcename the name to be registered as the "source" property for every edge in this tree.
 * @param test don't add to the database
 */
public void addSetTreeToGraphWIdsSet(String sourceName,boolean allTreesHaveAllTaxa,boolean runTestOnly,MessageLogger msgLogger) throws TaxonNotFoundException, TreeIngestException {
  this.runTestOnly=runTestOnly;
  this.allTreesHaveAllTaxa=allTreesHaveAllTaxa;
  this.logger=msgLogger;
  this.sourceName=sourceName;
  matchTaxaUsingTaxUIDs();
  loadTree();
  remapInputLeavesToDeepestTaxa();
}