Loading sdg-core/src/main/java/es/upv/mist/slicing/nodes/ObjectTreeConnection.java +5 −4 Original line number Diff line number Diff line Loading @@ -41,10 +41,8 @@ class ObjectTreeConnection implements VariableAction.PDGConnection { @Override public void apply(JSysPDG graph) { if (!applied) { if (!applied) connectTrees(graph, FlowDependencyArc::new, ObjectFlowDependencyArc::new); applied = true; } } protected void connectTrees(Graph graph, Supplier<Arc> flowSupplier, Supplier<Arc> objFlowSupplier) { Loading @@ -67,9 +65,12 @@ class ObjectTreeConnection implements VariableAction.PDGConnection { private void connectOT(ObjectTree source, ObjectTree target, GraphNode<?> rootSrc, GraphNode<?> rootTgt, Graph graph, Supplier<Arc> flowSupplier, Supplier<Arc> objFlowSupplier) { if (source == null || target == null) { if (!rootSrc.equals(rootTgt)) if (!rootSrc.equals(rootTgt)) { graph.addEdge(rootSrc, rootTgt, flowSupplier.get()); applied = true; } } else { applied = true; graph.addEdge(rootSrc, rootTgt, objFlowSupplier.get()); graph.addEdge(rootSrc, rootTgt, flowSupplier.get()); for (String treeMember : target.nameIterable()) { Loading sdg-core/src/main/java/es/upv/mist/slicing/nodes/ValueConnection.java +8 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ public class ValueConnection implements VariableAction.PDGConnection { protected final VariableAction action; protected final String member; protected boolean applied = false; public ValueConnection(VariableAction action, String member) { this.action = action; this.member = member.isEmpty() ? ROOT_NAME : ROOT_NAME + "." + member; Loading @@ -19,13 +21,18 @@ public class ValueConnection implements VariableAction.PDGConnection { @Override public void apply(JSysPDG graph) { if (applied) return; GraphNode<?> statementNode; if (action instanceof VariableAction.Movable) statementNode = ((VariableAction.Movable) action).getRealNode(); else statementNode = action.getGraphNode(); if (action.hasPolyTreeMember(member)) for (MemberNode source : action.getObjectTree().getNodesForPoly(member)) for (MemberNode source : action.getObjectTree().getNodesForPoly(member)) { graph.addEdge(source, statementNode, new FlowDependencyArc()); applied = true; } } } Loading
sdg-core/src/main/java/es/upv/mist/slicing/nodes/ObjectTreeConnection.java +5 −4 Original line number Diff line number Diff line Loading @@ -41,10 +41,8 @@ class ObjectTreeConnection implements VariableAction.PDGConnection { @Override public void apply(JSysPDG graph) { if (!applied) { if (!applied) connectTrees(graph, FlowDependencyArc::new, ObjectFlowDependencyArc::new); applied = true; } } protected void connectTrees(Graph graph, Supplier<Arc> flowSupplier, Supplier<Arc> objFlowSupplier) { Loading @@ -67,9 +65,12 @@ class ObjectTreeConnection implements VariableAction.PDGConnection { private void connectOT(ObjectTree source, ObjectTree target, GraphNode<?> rootSrc, GraphNode<?> rootTgt, Graph graph, Supplier<Arc> flowSupplier, Supplier<Arc> objFlowSupplier) { if (source == null || target == null) { if (!rootSrc.equals(rootTgt)) if (!rootSrc.equals(rootTgt)) { graph.addEdge(rootSrc, rootTgt, flowSupplier.get()); applied = true; } } else { applied = true; graph.addEdge(rootSrc, rootTgt, objFlowSupplier.get()); graph.addEdge(rootSrc, rootTgt, flowSupplier.get()); for (String treeMember : target.nameIterable()) { Loading
sdg-core/src/main/java/es/upv/mist/slicing/nodes/ValueConnection.java +8 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ public class ValueConnection implements VariableAction.PDGConnection { protected final VariableAction action; protected final String member; protected boolean applied = false; public ValueConnection(VariableAction action, String member) { this.action = action; this.member = member.isEmpty() ? ROOT_NAME : ROOT_NAME + "." + member; Loading @@ -19,13 +21,18 @@ public class ValueConnection implements VariableAction.PDGConnection { @Override public void apply(JSysPDG graph) { if (applied) return; GraphNode<?> statementNode; if (action instanceof VariableAction.Movable) statementNode = ((VariableAction.Movable) action).getRealNode(); else statementNode = action.getGraphNode(); if (action.hasPolyTreeMember(member)) for (MemberNode source : action.getObjectTree().getNodesForPoly(member)) for (MemberNode source : action.getObjectTree().getNodesForPoly(member)) { graph.addEdge(source, statementNode, new FlowDependencyArc()); applied = true; } } }