Program: 50214
Project: 50214
Buggy source:
public int pg_loading(String[] args){
  GraphDatabaseAgent graphDb=new GraphDatabaseAgent(args[1]);
  if (args.length != 3) {
    graphDb.shutdownDb();
    return 1;
  }
  String directory=args[2];
  System.out.println("String_Node_Str" + directory + "String_Node_Str"+ args[1]);
  File file=new File(directory);
  File[] files=file.listFiles();
  for (int i=0; i < files.length; i++) {
    if (i > 10) {
      break;
    }
    System.out.println("String_Node_Str" + files[i]);
    try {
      BufferedReader br=new BufferedReader(new FileReader(files[i]));
      List<JadeTree> jt=NexsonReader.readNexson(br);
      for (      JadeTree j : jt) {
        System.out.println(files[i] + "String_Node_Str" + j.getExternalNodeCount());
      }
      PhylografterConnector.fixNamesFromTrees(Long.valueOf(files[i].getName()),jt,graphDb);
      try {
        for (        JadeTree j : jt) {
          GraphImporter gi=new GraphImporter(graphDb);
          boolean doubname=false;
          HashSet<Long> ottols=new HashSet<Long>();
          for (int m=0; m < j.getExternalNodeCount(); m++) {
            System.out.println(j.getExternalNode(m).getName() + "String_Node_Str" + j.getExternalNode(m).getObject("String_Node_Str"));
            if (j.getExternalNode(m).getObject("String_Node_Str") == null) {
              doubname=true;
              break;
            }
            if (ottols.contains((Long)j.getExternalNode(m).getObject("String_Node_Str")) == true) {
              doubname=true;
              break;
            }
 else {
              ottols.add((Long)j.getExternalNode(m).getObject("String_Node_Str"));
            }
          }
          if (doubname == true) {
            System.out.println("String_Node_Str");
          }
 else {
            System.out.println("String_Node_Str");
            gi.setTree(j);
            String sourcename="String_Node_Str";
            if (j.getObject("String_Node_Str") != null) {
              sourcename=(String)j.getObject("String_Node_Str");
            }
            if (j.getObject("String_Node_Str") != null) {
              sourcename+="String_Node_Str" + (String)j.getObject("String_Node_Str");
            }
            Index<Node> sourceMetaIndex=graphDb.getNodeIndex("String_Node_Str");
            IndexHits<Node> hits=sourceMetaIndex.get("String_Node_Str",sourcename);
            if (hits.size() > 0) {
              System.out.println("String_Node_Str" + sourcename + "String_Node_Str");
            }
 else {
              gi.addSetTreeToGraphWIdsSet(sourcename);
            }
          }
        }
      }
 catch (      java.lang.NullPointerException e) {
        System.out.println("String_Node_Str" + files[i].getName());
        continue;
      }
catch (      TaxonNotFoundException e) {
        e.printStackTrace();
      }
catch (      TreeIngestException e) {
        e.printStackTrace();
      }
      br.close();
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
catch (    java.lang.NullPointerException e) {
      e.printStackTrace();
    }
  }
  graphDb.shutdownDb();
  return 0;
}

Fixed version (ground truth):
public int pg_loading(String[] args){
  GraphDatabaseAgent graphDb=new GraphDatabaseAgent(args[1]);
  if (args.length != 3) {
    graphDb.shutdownDb();
    return 1;
  }
  String directory=args[2];
  System.out.println("String_Node_Str" + directory + "String_Node_Str"+ args[1]);
  File file=new File(directory);
  File[] files=file.listFiles();
  for (int i=0; i < files.length; i++) {
    System.out.println("String_Node_Str" + files[i]);
    try {
      BufferedReader br=new BufferedReader(new FileReader(files[i]));
      List<JadeTree> jt=NexsonReader.readNexson(br);
      for (      JadeTree j : jt) {
        System.out.println(files[i] + "String_Node_Str" + j.getExternalNodeCount());
      }
      PhylografterConnector.fixNamesFromTrees(Long.valueOf(files[i].getName()),jt,graphDb);
      try {
        for (        JadeTree j : jt) {
          GraphImporter gi=new GraphImporter(graphDb);
          boolean doubname=false;
          HashSet<Long> ottols=new HashSet<Long>();
          for (int m=0; m < j.getExternalNodeCount(); m++) {
            System.out.println(j.getExternalNode(m).getName() + "String_Node_Str" + j.getExternalNode(m).getObject("String_Node_Str"));
            if (j.getExternalNode(m).getObject("String_Node_Str") == null) {
              doubname=true;
              break;
            }
            if (ottols.contains((Long)j.getExternalNode(m).getObject("String_Node_Str")) == true) {
              doubname=true;
              break;
            }
 else {
              ottols.add((Long)j.getExternalNode(m).getObject("String_Node_Str"));
            }
          }
          if (doubname == true) {
            System.out.println("String_Node_Str");
          }
 else {
            System.out.println("String_Node_Str");
            gi.setTree(j);
            String sourcename="String_Node_Str";
            if (j.getObject("String_Node_Str") != null) {
              sourcename=(String)j.getObject("String_Node_Str");
            }
            if (j.getObject("String_Node_Str") != null) {
              sourcename+="String_Node_Str" + (String)j.getObject("String_Node_Str");
            }
            Index<Node> sourceMetaIndex=graphDb.getNodeIndex("String_Node_Str");
            IndexHits<Node> hits=sourceMetaIndex.get("String_Node_Str",sourcename);
            if (hits.size() > 0) {
              System.out.println("String_Node_Str" + sourcename + "String_Node_Str");
            }
 else {
              gi.addSetTreeToGraphWIdsSet(sourcename);
            }
          }
        }
      }
 catch (      java.lang.NullPointerException e) {
        System.out.println("String_Node_Str" + files[i].getName());
        continue;
      }
catch (      TaxonNotFoundException e) {
        e.printStackTrace();
      }
catch (      TreeIngestException e) {
        e.printStackTrace();
      }
      br.close();
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
catch (    java.lang.NullPointerException e) {
      e.printStackTrace();
    }
  }
  graphDb.shutdownDb();
  return 0;
}