Program: 50177
Project: 50177
Buggy source:
/** 
 * Reads a taxonomy file with rows formatted as: taxon_id,parent_id,Name with spaces allowed\n The source name is going to be OTTOL Creates the nodes and TAXCHILDOF relationship for a taxonomy tree Node objects will get a "name", "mrca", and "nested_mrca" properties They will also get tax_uid, tax_parent_uid, tax_rank, tax_source, tax_sourceid, tax_sourcepid, uniqname TAXCHILDOF relationships will get "source" of "ottol", "childid", and "parentid" properties with the addition of the new information in the ottol dumps the nodes will also get properties STREECHILDOF relationships will get "source" properties as "taxonomy" Nodes are indexed in graphNamedNodes with their name as the value for a "name" key This will load the taxonomy, adding 
 * @param filename file path to the taxonomy file
 * @param synonymfile file that has the synonyms as dumped by ottol dump
 * @throws TaxonNotFoundException 
 */
public void addInitialTaxonomyTableIntoGraph(String filename,String synonymfile,String taxonomyversion) throws TaxonNotFoundException {
  initContainersForTaxLoading();
  String str="String_Node_Str";
  int count=0;
  if (synonymfile.length() > 0) {
    synFileExists=true;
  }
  if (synFileExists) {
    synonymHash=new HashMap<String,ArrayList<ArrayList<String>>>();
    try {
      BufferedReader sbr=new BufferedReader(new FileReader(synonymfile));
      while ((str=sbr.readLine()) != null) {
        StringTokenizer st=new StringTokenizer(str,"String_Node_Str");
        String name=st.nextToken();
        String parentuid=st.nextToken();
        String uid=parentuid;
        String type="String_Node_Str";
        String source="String_Node_Str";
        ArrayList<String> tar=new ArrayList<String>();
        tar.add(uid);
        tar.add(name);
        tar.add(type);
        tar.add(source);
        if (synonymHash.get(parentuid) == null) {
          ArrayList<ArrayList<String>> ttar=new ArrayList<ArrayList<String>>();
          synonymHash.put(parentuid,ttar);
        }
        synonymHash.get(parentuid).add(tar);
      }
      sbr.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
      System.exit(0);
    }
    System.out.println("String_Node_Str" + synonymHash.size());
  }
  Transaction tx;
  ArrayList<String> templines=new ArrayList<String>();
  try {
    BufferedReader br=new BufferedReader(new FileReader(filename));
    while ((str=br.readLine()) != null) {
      if (count == 0) {
        if (str.startsWith("String_Node_Str")) {
          System.out.println("String_Node_Str" + str);
          continue;
        }
      }
      count+=1;
      templines.add(str);
      if (count % transactionFrequency == 0) {
        System.out.print("String_Node_Str" + count);
        System.out.print("String_Node_Str");
        tx=graphDb.beginTx();
        try {
          for (int i=0; i < templines.size(); i++) {
            processTaxInputLine(templines.get(i),taxonomyversion);
          }
          tx.success();
        }
  finally {
          tx.finish();
        }
        templines.clear();
      }
    }
    br.close();
    tx=graphDb.beginTx();
    try {
      for (int i=0; i < templines.size(); i++) {
        processTaxInputLine(templines.get(i),taxonomyversion);
      }
      tx.success();
    }
  finally {
      tx.finish();
    }
    templines.clear();
    ArrayList<String> temppar=new ArrayList<String>();
    count=0;
    for (    String key : taxUIDToNodeMap.keySet()) {
      count+=1;
      temppar.add(key);
      if (count % transactionFrequency == 0) {
        System.out.println(count);
        tx=graphDb.beginTx();
        try {
          for (int i=0; i < temppar.size(); i++) {
            try {
              addParentRelationshipForTaxUID(temppar.get(i));
            }
 catch (            java.lang.IllegalArgumentException io) {
              continue;
            }
          }
          tx.success();
        }
  finally {
          tx.finish();
        }
        temppar.clear();
      }
    }
    tx=graphDb.beginTx();
    try {
      for (int i=0; i < temppar.size(); i++) {
        try {
          addParentRelationshipForTaxUID(temppar.get(i));
        }
 catch (        java.lang.IllegalArgumentException io) {
          continue;
        }
      }
      tx.success();
    }
  finally {
      tx.finish();
    }
  }
 catch (  IOException ioe) {
  }
  initMrcaAndStreeRelsTax();
}

Fixed version (ground truth):
/** 
 * Reads a taxonomy file with rows formatted as: taxon_id,parent_id,Name with spaces allowed\n The source name is going to be OTTOL Creates the nodes and TAXCHILDOF relationship for a taxonomy tree Node objects will get a "name", "mrca", and "nested_mrca" properties They will also get tax_uid, tax_parent_uid, tax_rank, tax_source, tax_sourceid, tax_sourcepid, uniqname TAXCHILDOF relationships will get "source" of "ottol", "childid", and "parentid" properties with the addition of the new information in the ottol dumps the nodes will also get properties STREECHILDOF relationships will get "source" properties as "taxonomy" Nodes are indexed in graphNamedNodes with their name as the value for a "name" key This will load the taxonomy, adding 
 * @param filename file path to the taxonomy file
 * @param synonymfile file that has the synonyms as dumped by ottol dump
 * @throws TaxonNotFoundException 
 */
public void addInitialTaxonomyTableIntoGraph(String filename,String synonymfile,String taxonomyversion) throws TaxonNotFoundException {
  initContainersForTaxLoading();
  String str="String_Node_Str";
  int count=0;
  if (synonymfile.length() > 0) {
    synFileExists=true;
  }
  if (synFileExists) {
    synonymHash=new HashMap<String,ArrayList<ArrayList<String>>>();
    try {
      BufferedReader sbr=new BufferedReader(new FileReader(synonymfile));
      while ((str=sbr.readLine()) != null) {
        if (!str.trim().equals("String_Node_Str")) {
          StringTokenizer st=new StringTokenizer(str,"String_Node_Str");
          String name=st.nextToken();
          String parentuid=st.nextToken();
          String uid=parentuid;
          String type="String_Node_Str";
          String source="String_Node_Str";
          ArrayList<String> tar=new ArrayList<String>();
          tar.add(uid);
          tar.add(name);
          tar.add(type);
          tar.add(source);
          if (synonymHash.get(parentuid) == null) {
            ArrayList<ArrayList<String>> ttar=new ArrayList<ArrayList<String>>();
            synonymHash.put(parentuid,ttar);
          }
          synonymHash.get(parentuid).add(tar);
        }
      }
      sbr.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
      System.exit(0);
    }
    System.out.println("String_Node_Str" + synonymHash.size());
  }
  Transaction tx;
  ArrayList<String> templines=new ArrayList<String>();
  try {
    BufferedReader br=new BufferedReader(new FileReader(filename));
    while ((str=br.readLine()) != null) {
      if (!str.trim().equals("String_Node_Str")) {
        if (count == 0) {
          if (str.startsWith("String_Node_Str")) {
            System.out.println("String_Node_Str" + str);
            continue;
          }
        }
        count+=1;
        templines.add(str);
        if (count % transactionFrequency == 0) {
          System.out.print("String_Node_Str" + count);
          System.out.print("String_Node_Str");
          tx=graphDb.beginTx();
          try {
            for (int i=0; i < templines.size(); i++) {
              processTaxInputLine(templines.get(i),taxonomyversion);
            }
            tx.success();
          }
  finally {
            tx.finish();
          }
          templines.clear();
        }
      }
    }
    br.close();
    tx=graphDb.beginTx();
    try {
      for (int i=0; i < templines.size(); i++) {
        processTaxInputLine(templines.get(i),taxonomyversion);
      }
      tx.success();
    }
  finally {
      tx.finish();
    }
    templines.clear();
    ArrayList<String> temppar=new ArrayList<String>();
    count=0;
    for (    String key : taxUIDToNodeMap.keySet()) {
      count+=1;
      temppar.add(key);
      if (count % transactionFrequency == 0) {
        System.out.println(count);
        tx=graphDb.beginTx();
        try {
          for (int i=0; i < temppar.size(); i++) {
            try {
              addParentRelationshipForTaxUID(temppar.get(i));
            }
 catch (            java.lang.IllegalArgumentException io) {
              continue;
            }
          }
          tx.success();
        }
  finally {
          tx.finish();
        }
        temppar.clear();
      }
    }
    tx=graphDb.beginTx();
    try {
      for (int i=0; i < temppar.size(); i++) {
        try {
          addParentRelationshipForTaxUID(temppar.get(i));
        }
 catch (        java.lang.IllegalArgumentException io) {
          continue;
        }
      }
      tx.success();
    }
  finally {
      tx.finish();
    }
  }
 catch (  IOException ioe) {
  }
  initMrcaAndStreeRelsTax();
}