diff --git a/AlgebraicDataflowArchitectureModel/src/models/controlFlowModel/ObjectNode.java b/AlgebraicDataflowArchitectureModel/src/models/controlFlowModel/ObjectNode.java index 9303eb3..dedb5af 100644 --- a/AlgebraicDataflowArchitectureModel/src/models/controlFlowModel/ObjectNode.java +++ b/AlgebraicDataflowArchitectureModel/src/models/controlFlowModel/ObjectNode.java @@ -80,11 +80,13 @@ /************************************************************* * */ - public void sortOutEdgesByCallOrder(final int curOrder, final int callOrder) { + public void sortOutEdgesByCallOrder(final int curOrder, final int newCallOrder) { ArrayList edges = ((ArrayList)outEdges); - Edge edge = ((List)outEdges).get(curOrder); + Edge selectedEdge = ((List)outEdges).get(curOrder); - edges.remove(curOrder); - edges.add(callOrder-1, edge); + Edge tempEdge = ((List)outEdges).get(newCallOrder - 1); + + edges.set(newCallOrder - 1, selectedEdge); + edges.set(curOrder, tempEdge); } }