Commit 1ec101c4 authored by Jonathan Andrade's avatar Jonathan Andrade
Browse files

fix to counterexample 3

parent b28dc377
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -338,12 +338,14 @@ public class ICFG extends es.upv.mist.slicing.graphs.Graph implements Buildable<

        private static void mergeGraphs(IntraSCR target, IntraSCR src) {
            for (GraphNode<?> n : src.vertexSet())
                if (!target.addVertex(n))
                if (!target.vertexSet().contains(n) && !target.addVertex(n))
                    throw new RuntimeException();
            for (Arc arc : src.edgeSet())
                if (!target.addEdge(src.getEdgeSource(arc), src.getEdgeTarget(arc), arc))
            for (Arc arc : src.edgeSet()) {
                Arc edge = target.getEdge(src.getEdgeSource(arc), src.getEdgeTarget(arc));
                if (edge == null && !target.addEdge(src.getEdgeSource(arc), src.getEdgeTarget(arc), arc))
                    throw new RuntimeException();
            }
        }

        private void buildISCRGraph(IntraSCR intraSCR, List<IntraSCR> processedIntraSCRs) {
            if (processedIntraSCRs.contains(intraSCR)) {
+4 −4
Original line number Diff line number Diff line
@@ -47,8 +47,8 @@ public class ICFGTest {
        createGraph("Test6.java", "grafoTest6");
        System.out.println("Grafo 11 generado...");*/

        createGraph("TestExamplePaperSimple.java", "grafoPaperSimple");
        System.out.println("Grafo 12 generado...");
        /*createGraph("TestExamplePaperSimple.java", "grafoPaperSimple");
        System.out.println("Grafo 12 generado...");*/

        /* createGraph("TestExamplePaperSimpleContra1.java", "contra1");
        System.out.println("Grafo 13 generado...");*/
@@ -56,8 +56,8 @@ public class ICFGTest {
        /* createGraph("TestExamplePaperSimpleContra2.java", "contra2");
        System.out.println("Grafo 14 generado..."); */

        /* createGraph("TestExamplePaperSimpleContra3.java", "contra3");
        System.out.println("Grafo 15 generado...");*/
        createGraph("TestExamplePaperSimpleContra3.java", "contra3");
        System.out.println("Grafo 15 generado...");

        /* createGraph("TestExamplePaperSimpleContra4.java", "contra4");
        System.out.println("Grafo 16 generado..."); */