Program: 32317
Project: 32317
Buggy source:
@Override public void run(){
  logger.info("String_Node_Str");
  GlobalGraphOperations globalGraphOperations=GlobalGraphOperations.at(graphDb);
  Transaction tx=graphDb.beginTx();
  ResourceIterable<Node> allNodes=globalGraphOperations.getAllNodes();
  int size=Iterators.size(allNodes.iterator());
  tx.success();
  tx.close();
  logger.info(size + "String_Node_Str");
  tx=graphDb.beginTx();
  TraversalDescription traversalDescription=graphDb.traversalDescription().breadthFirst().uniqueness(Uniqueness.NODE_GLOBAL);
  for (  RelationshipType rel : relationships) {
    traversalDescription=traversalDescription.relationships(rel,Direction.BOTH);
  }
  Set<Long> processedNodes=new HashSet<Long>();
  for (  Node baseNode : allNodes) {
    size-=1;
    if (size % 100000 == 0) {
      logger.info(size + "String_Node_Str");
    }
    if (size % 10 == 0) {
      tx.success();
      tx.close();
      tx=graphDb.beginTx();
    }
    logger.fine("String_Node_Str" + baseNode.getProperty(NodeProperties.IRI));
    if (!processedNodes.contains(baseNode.getId())) {
      List<Node> clique=new ArrayList<Node>();
      for (      Node node : traversalDescription.traverse(baseNode).nodes()) {
        logger.fine("String_Node_Str" + node.getProperty(NodeProperties.IRI));
        clique.add(node);
        processedNodes.add(node.getId());
      }
      logger.fine("String_Node_Str" + clique.size());
      if (clique.size() == 1) {
        Node defactoLeader=clique.get(0);
        markAsCliqueLeader(defactoLeader);
      }
 else {
        Node leader=electCliqueLeader(clique,prefixLeaderPriority);
        markAsCliqueLeader(leader);
        clique.remove(leader);
        ensureLabel(leader,clique);
        moveEdgesToLeader(leader,clique,tx);
      }
    }
  }
  tx.success();
  tx.close();
}

Fixed version (ground truth):
@Override public void run(){
  logger.info("String_Node_Str");
  GlobalGraphOperations globalGraphOperations=GlobalGraphOperations.at(graphDb);
  Transaction tx=graphDb.beginTx();
  ResourceIterable<Node> allNodes=globalGraphOperations.getAllNodes();
  int size=Iterators.size(allNodes.iterator());
  tx.success();
  tx.close();
  logger.info(size + "String_Node_Str");
  tx=graphDb.beginTx();
  TraversalDescription traversalDescription=graphDb.traversalDescription().breadthFirst().uniqueness(Uniqueness.NODE_GLOBAL);
  for (  RelationshipType rel : relationships) {
    traversalDescription=traversalDescription.relationships(rel,Direction.BOTH);
  }
  Set<Long> processedNodes=new HashSet<Long>();
  for (  Node baseNode : allNodes) {
    size-=1;
    if (size % 100000 == 0) {
      logger.info(size + "String_Node_Str");
    }
    if (size % 10 == 0) {
      logger.fine("String_Node_Str");
      tx.success();
      tx.close();
      tx=graphDb.beginTx();
    }
    logger.fine("String_Node_Str" + baseNode.getProperty(NodeProperties.IRI));
    if (!processedNodes.contains(baseNode.getId())) {
      List<Node> clique=new ArrayList<Node>();
      for (      Node node : traversalDescription.traverse(baseNode).nodes()) {
        logger.fine("String_Node_Str" + node.getProperty(NodeProperties.IRI));
        clique.add(node);
        processedNodes.add(node.getId());
      }
      logger.fine("String_Node_Str" + clique.size());
      if (clique.size() == 1) {
        Node defactoLeader=clique.get(0);
        markAsCliqueLeader(defactoLeader);
      }
 else {
        Node leader=electCliqueLeader(clique,prefixLeaderPriority);
        markAsCliqueLeader(leader);
        clique.remove(leader);
        moveEdgesToLeader(leader,clique,tx);
        ensureLabel(leader,clique);
      }
    }
  }
  tx.success();
  tx.close();
}