Program: 57741
Project: 57741
Buggy source:
private void createNodes(){
  linearizedNodes.clear();
  branchNodes.clear();
  branchNodesToLinearizedNodesMap.clear();
  linearizedNodesToIncomingBranchSummaryNodesMap.clear();
  linearizedNodesToOutgoingBranchSummaryNodesMap.clear();
  createNodesForList(linearizedNodes,path);
  for (int i=0; i < linearizedNodes.size(); i++) {
    ALinearizableNode currentNode=linearizedNodes.get(i);
    PathwayVertexRep currentVertexRep=currentNode.getPathwayVertexRep();
    DefaultEdge prevEdge=null;
    DefaultEdge nextEdge=null;
    if (i > 0) {
      ALinearizableNode prevNode=linearizedNodes.get(i - 1);
      prevEdge=pathway.getEdge(prevNode.getPathwayVertexRep(),currentVertexRep);
      if (prevEdge == null)       prevEdge=pathway.getEdge(currentVertexRep,prevNode.getPathwayVertexRep());
    }
    if (i != linearizedNodes.size() - 1) {
      ALinearizableNode nextNode=linearizedNodes.get(i + 1);
      nextEdge=pathway.getEdge(nextNode.getPathwayVertexRep(),currentVertexRep);
      if (nextEdge == null)       nextEdge=pathway.getEdge(currentVertexRep,nextNode.getPathwayVertexRep());
    }
    Set<DefaultEdge> edges=pathway.edgesOf(currentVertexRep);
    BranchSummaryNode incomingNode=new BranchSummaryNode(this,lastNodeId++,currentNode);
    BranchSummaryNode outgoingNode=new BranchSummaryNode(this,lastNodeId++,currentNode);
    List<PathwayVertexRep> sourceVertexReps=new ArrayList<PathwayVertexRep>();
    List<PathwayVertexRep> targetVertexReps=new ArrayList<PathwayVertexRep>();
    for (    DefaultEdge edge : edges) {
      if ((edge != prevEdge) && (edge != nextEdge)) {
        if (pathway.getEdgeTarget(edge) == currentVertexRep) {
          sourceVertexReps.add(pathway.getEdgeSource(edge));
        }
 else {
          targetVertexReps.add(pathway.getEdgeTarget(edge));
        }
      }
    }
    if (sourceVertexReps.size() > 0) {
      List<ALinearizableNode> sourceNodes=new ArrayList<ALinearizableNode>();
      createNodesForList(sourceNodes,sourceVertexReps);
      incomingNode.setBranchNodes(sourceNodes);
      linearizedNodesToIncomingBranchSummaryNodesMap.put(currentNode,incomingNode);
      branchNodes.add(incomingNode);
      branchNodes.addAll(sourceNodes);
      for (      ANode node : sourceNodes) {
        ((ALinearizableNode)node).setPreviewMode(true);
        branchNodesToLinearizedNodesMap.put(node,currentNode);
      }
    }
    if (targetVertexReps.size() > 0) {
      List<ALinearizableNode> targetNodes=new ArrayList<ALinearizableNode>();
      createNodesForList(targetNodes,targetVertexReps);
      outgoingNode.setBranchNodes(targetNodes);
      linearizedNodesToOutgoingBranchSummaryNodesMap.put(currentNode,outgoingNode);
      branchNodes.add(outgoingNode);
      branchNodes.addAll(targetNodes);
      for (      ANode node : targetNodes) {
        ((ALinearizableNode)node).setPreviewMode(true);
        branchNodesToLinearizedNodesMap.put(node,currentNode);
      }
    }
  }
}

Fixed version (ground truth):
private void createNodes(){
  linearizedNodes.clear();
  branchNodes.clear();
  branchNodesToLinearizedNodesMap.clear();
  linearizedNodesToIncomingBranchSummaryNodesMap.clear();
  linearizedNodesToOutgoingBranchSummaryNodesMap.clear();
  createNodesForList(linearizedNodes,path);
  for (int i=0; i < linearizedNodes.size(); i++) {
    ALinearizableNode currentNode=linearizedNodes.get(i);
    PathwayVertexRep currentVertexRep=currentNode.getPathwayVertexRep();
    PathwayVertexRep prevVertexRep=null;
    PathwayVertexRep nextVertexRep=null;
    if (i > 0) {
      ALinearizableNode prevNode=linearizedNodes.get(i - 1);
      prevVertexRep=prevNode.getPathwayVertexRep();
    }
    if (i != linearizedNodes.size() - 1) {
      ALinearizableNode nextNode=linearizedNodes.get(i + 1);
      nextVertexRep=nextNode.getPathwayVertexRep();
    }
    BranchSummaryNode incomingNode=new BranchSummaryNode(this,lastNodeId++,currentNode);
    BranchSummaryNode outgoingNode=new BranchSummaryNode(this,lastNodeId++,currentNode);
    List<PathwayVertexRep> sourceVertexReps=Graphs.successorListOf(pathway,currentVertexRep);
    sourceVertexReps.remove(prevVertexRep);
    List<PathwayVertexRep> targetVertexReps=Graphs.predecessorListOf(pathway,currentVertexRep);
    targetVertexReps.remove(nextVertexRep);
    if (sourceVertexReps.size() > 0) {
      List<ALinearizableNode> sourceNodes=new ArrayList<ALinearizableNode>();
      createNodesForList(sourceNodes,sourceVertexReps);
      incomingNode.setBranchNodes(sourceNodes);
      linearizedNodesToIncomingBranchSummaryNodesMap.put(currentNode,incomingNode);
      branchNodes.add(incomingNode);
      branchNodes.addAll(sourceNodes);
      for (      ANode node : sourceNodes) {
        ((ALinearizableNode)node).setPreviewMode(true);
        branchNodesToLinearizedNodesMap.put(node,currentNode);
      }
    }
    if (targetVertexReps.size() > 0) {
      List<ALinearizableNode> targetNodes=new ArrayList<ALinearizableNode>();
      createNodesForList(targetNodes,targetVertexReps);
      outgoingNode.setBranchNodes(targetNodes);
      linearizedNodesToOutgoingBranchSummaryNodesMap.put(currentNode,outgoingNode);
      branchNodes.add(outgoingNode);
      branchNodes.addAll(targetNodes);
      for (      ANode node : targetNodes) {
        ((ALinearizableNode)node).setPreviewMode(true);
        branchNodesToLinearizedNodesMap.put(node,currentNode);
      }
    }
  }
}