Program: 55138
Project: 55138
Buggy source:
public static Path exportSubgraphToHDFSParallel(GraphDatabaseService db) throws IOException, URISyntaxException {
  FileSystem fs=FileUtil.getHadoopFileSystem();
  Path pt=new Path(ConfigurationLoader.getInstance().getHadoopHdfsUri() + EDGE_LIST_RELATIVE_FILE_PATH);
  BufferedWriter br=new BufferedWriter(new OutputStreamWriter(fs.create(pt)));
  Integer reportBlockSize=20000;
  Transaction tx=db.beginTx();
  Iterable<Node> nodes=GlobalGraphOperations.at(db).getAllNodes();
  br.write("String_Node_Str" + "String_Node_Str");
  List<Spliterator<Node>> spliteratorList=new ArrayList<>();
  boolean hasSpliterator=true;
  Spliterator<Node> nodeSpliterator=nodes.spliterator();
  while (hasSpliterator) {
    Spliterator<Node> localSpliterator=nodeSpliterator.trySplit();
    hasSpliterator=localSpliterator != null;
    if (hasSpliterator)     spliteratorList.add(localSpliterator);
  }
  tx.success();
  tx.close();
  counter=0;
  if (spliteratorList.size() > 4) {
    ParallelWriter parallelWriter=new ParallelWriter(spliteratorList.toArray(new Spliterator[spliteratorList.size()]),0,spliteratorList.size(),db,br,spliteratorList.size(),reportBlockSize,ConfigurationLoader.getInstance().getMazerunnerRelationshipType());
    ForkJoinPool pool=new ForkJoinPool();
    pool.invoke(parallelWriter);
  }
 else {
    spliteratorList.forEach(sl -> sl.forEachRemaining(n -> {
      try {
        writeBlockForNode(n,db,br,reportBlockSize,ConfigurationLoader.getInstance().getMazerunnerRelationshipType());
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
));
  }
  System.out.println("String_Node_Str" + MessageFormat.format("String_Node_Str",1.0));
  br.flush();
  br.close();
  return pt;
}

Fixed version (ground truth):
public static Path exportSubgraphToHDFSParallel(GraphDatabaseService db) throws IOException, URISyntaxException {
  FileSystem fs=FileUtil.getHadoopFileSystem();
  Path pt=new Path(ConfigurationLoader.getInstance().getHadoopHdfsUri() + EDGE_LIST_RELATIVE_FILE_PATH.replace("String_Node_Str","String_Node_Str"));
  BufferedWriter br=new BufferedWriter(new OutputStreamWriter(fs.create(pt)));
  Integer reportBlockSize=20000;
  Transaction tx=db.beginTx();
  Iterable<Node> nodes=GlobalGraphOperations.at(db).getAllNodes();
  br.write("String_Node_Str" + "String_Node_Str");
  List<Spliterator<Node>> spliteratorList=new ArrayList<>();
  boolean hasSpliterator=true;
  Spliterator<Node> nodeSpliterator=nodes.spliterator();
  while (hasSpliterator) {
    Spliterator<Node> localSpliterator=nodeSpliterator.trySplit();
    hasSpliterator=localSpliterator != null;
    if (hasSpliterator)     spliteratorList.add(localSpliterator);
  }
  tx.success();
  tx.close();
  counter=0;
  if (spliteratorList.size() > 4) {
    ParallelWriter parallelWriter=new ParallelWriter(spliteratorList.toArray(new Spliterator[spliteratorList.size()]),0,spliteratorList.size(),db,br,spliteratorList.size(),reportBlockSize,ConfigurationLoader.getInstance().getMazerunnerRelationshipType());
    ForkJoinPool pool=new ForkJoinPool();
    pool.invoke(parallelWriter);
  }
 else {
    spliteratorList.forEach(sl -> sl.forEachRemaining(n -> {
      try {
        writeBlockForNode(n,db,br,reportBlockSize,ConfigurationLoader.getInstance().getMazerunnerRelationshipType());
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
));
  }
  System.out.println("String_Node_Str" + MessageFormat.format("String_Node_Str",1.0));
  br.flush();
  br.close();
  return pt;
}