Program: 83970
Project: 83970
Buggy source:
public synchronized boolean addNode(String resourcePath){
  logger.info("String_Node_Str" + resourcePath);
  if (resourcePath != null) {
    Resource resource=RESTServer.getResource(resourcePath);
    Vertex thisVertex=null;
    boolean symlink=false;
    if ((thisVertex=internalGraph.insertVertex(resourcePath)) != null) {
      thisVertex.set("String_Node_Str",resourcePath);
      String linksToStr=null;
      if (resource.getType() == ResourceUtils.DEFAULT_RSRC || resource.getType() == ResourceUtils.GENERIC_PUBLISHER_RSRC) {
        pubNodes.put(resource.getURI(),thisVertex);
      }
 else       if (resource.getType() == ResourceUtils.SYMLINK_RSRC) {
        symlinkNodes.put(resource.getURI(),thisVertex);
        linksToStr=((SymlinkResource)resource).getLinkString();
        Vertex linksToNode=null;
        if (linksToStr.startsWith("String_Node_Str")) {
          Vertex node=getVertex(linksToStr);
          if (node == null) {
            node=internalGraph.insertVertex(linksToStr);
            node.set("String_Node_Str",linksToStr);
          }
          externalNodes.put(linksToStr,node);
        }
 else {
          linksToNode=getVertex(linksToStr);
        }
        internalGraph.insertDirectedEdge(thisVertex,linksToNode,"String_Node_Str");
        symlink=true;
        routerAddLink(resourcePath,linksToStr);
      }
 else {
        nonpubNodes.put(resource.getURI(),thisVertex);
        String parent=getParentPath(resource.getURI());
        Vertex parentVertex=getVertex(parent);
      }
      String parent=getParentPath(resource.getURI());
      Vertex parentVertex=getVertex(parent);
      if (symlink) {
        internalGraph.insertDirectedEdge(parentVertex,thisVertex,"String_Node_Str");
        routerAddLink(parent,resourcePath);
        if (hasCycle()) {
          removeNode((String)thisVertex.get("String_Node_Str"));
          Vertex linksToVertex=getVertex(linksToStr);
          removeNode((String)linksToVertex.get("String_Node_Str"));
          routerRemoveNode((String)thisVertex.get("String_Node_Str"));
          routerRemoveNode((String)linksToVertex.get("String_Node_Str"));
          return false;
        }
 else {
          logger.fine("String_Node_Str");
        }
      }
 else {
        internalGraph.insertDirectedEdge(parentVertex,thisVertex,"String_Node_Str");
        routerAddLink(parent,resourcePath);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public synchronized boolean addNode(String resourcePath){
  logger.info("String_Node_Str" + resourcePath);
  if (resourcePath != null) {
    Resource resource=RESTServer.getResource(resourcePath);
    Vertex thisVertex=null;
    boolean symlink=false;
    if ((thisVertex=internalGraph.insertVertex(resourcePath)) != null) {
      routerAddNode(resourcePath);
      thisVertex.set("String_Node_Str",resourcePath);
      String linksToStr=null;
      if (resource.getType() == ResourceUtils.DEFAULT_RSRC || resource.getType() == ResourceUtils.GENERIC_PUBLISHER_RSRC) {
        pubNodes.put(resource.getURI(),thisVertex);
      }
 else       if (resource.getType() == ResourceUtils.SYMLINK_RSRC) {
        symlinkNodes.put(resource.getURI(),thisVertex);
        linksToStr=((SymlinkResource)resource).getLinkString();
        Vertex linksToNode=null;
        if (linksToStr.startsWith("String_Node_Str")) {
          Vertex node=getVertex(linksToStr);
          if (node == null) {
            node=internalGraph.insertVertex(linksToStr);
            node.set("String_Node_Str",linksToStr);
          }
          externalNodes.put(linksToStr,node);
        }
 else {
          linksToNode=getVertex(linksToStr);
        }
        internalGraph.insertDirectedEdge(thisVertex,linksToNode,"String_Node_Str");
        symlink=true;
        routerAddLink(resourcePath,linksToStr);
      }
 else {
        nonpubNodes.put(resource.getURI(),thisVertex);
        String parent=getParentPath(resource.getURI());
        Vertex parentVertex=getVertex(parent);
      }
      String parent=getParentPath(resource.getURI());
      Vertex parentVertex=getVertex(parent);
      if (symlink) {
        internalGraph.insertDirectedEdge(parentVertex,thisVertex,"String_Node_Str");
        routerAddLink(parent,resourcePath);
        if (hasCycle()) {
          removeNode((String)thisVertex.get("String_Node_Str"));
          Vertex linksToVertex=getVertex(linksToStr);
          removeNode((String)linksToVertex.get("String_Node_Str"));
          routerRemoveNode((String)thisVertex.get("String_Node_Str"));
          routerRemoveNode((String)linksToVertex.get("String_Node_Str"));
          return false;
        }
 else {
          logger.fine("String_Node_Str");
        }
      }
 else {
        internalGraph.insertDirectedEdge(parentVertex,thisVertex,"String_Node_Str");
        routerAddLink(parent,resourcePath);
      }
      return true;
    }
  }
  return false;
}