public void changeEdgeNode(EdgeDirection direction, StatEdge edge, Statement value) {
    cancellationManager.checkCanceled();

    Map<EdgeType, List<StatEdge>> mapEdges = direction == EdgeDirection.BACKWARD ? mapPredEdges : mapSuccEdges;
    Map<EdgeType, List<Statement>> mapStates = direction == EdgeDirection.BACKWARD ? mapPredStates : mapSuccStates;

    EdgeType type = edge.getType();

    EdgeType[] arrtypes;
    if (type == EdgeType.EXCEPTION) {
      arrtypes = new EdgeType[]{EdgeType.ALL, EdgeType.EXCEPTION};
    }
    else {
      arrtypes = new EdgeType[]{EdgeType.ALL, EdgeType.DIRECT_ALL, type};
    }

    for (EdgeType edgetype : arrtypes) {
      List<StatEdge> lst = mapEdges.get(edgetype);
      if (lst != null) {
        int index = lst.indexOf(edge);
        if (index >= 0) {
          mapStates.get(edgetype).set(index, value);
        }
      }
    }

    if (direction == EdgeDirection.BACKWARD) {
      edge.setSource(value);
    }
    else {
      edge.setDestination(value);
    }
  }
public void changeEdgeNode(EdgeDirection direction, StatEdge edge, Statement value)