Commit 35a9f6e6 authored by Carlos Galindo's avatar Carlos Galindo Committed by Carlos Galindo
Browse files

Inverted condition related to METHOD_EXIT

parent d2ded147
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ public class CFG extends GraphWithRootNode<MethodDeclaration> {
    @Override
    public void build(MethodDeclaration method) {
        method.accept(newCFGBuilder(), null);
        if (vertexSet().stream().anyMatch(n -> n.getNodeType() == NodeType.METHOD_EXIT))
        if (vertexSet().stream().noneMatch(n -> n.getNodeType() == NodeType.METHOD_EXIT))
            throw new IllegalStateException("There is no exit node after building the graph");
        built = true;
    }/**/
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class PDGBuilder {

        // Copy nodes from CFG to PDG
        cfg.vertexSet().stream()
                .filter(node -> node.getNodeType() == NodeType.METHOD_EXIT)
                .filter(node -> node.getNodeType() != NodeType.METHOD_EXIT)
                .forEach(node -> pdg.addVertex(node));

        assert this.cfg.getRootNode().isPresent();