From b0fe4738e3e6bf7b5352ca72e1704ceab52a62e6 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Tue, 2 Apr 2019 19:54:47 +0200 Subject: [PATCH] Remove warnings --- src/main/java/grafos/Visitador.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/grafos/Visitador.java b/src/main/java/grafos/Visitador.java index 7a926cc..56a9799 100755 --- a/src/main/java/grafos/Visitador.java +++ b/src/main/java/grafos/Visitador.java @@ -139,7 +139,7 @@ public class Visitador extends VoidVisitorAdapter { @Override public void visit(ForeachStmt n, CFG graph) { - ForeachStmt copy = new ForeachStmt(n.getTokenRange().get(), n.getVariable(), n.getIterable(), new EmptyStmt()); + ForeachStmt copy = new ForeachStmt(n.getTokenRange().isPresent() ? n.getTokenRange().get() : null, n.getVariable(), n.getIterable(), new EmptyStmt()); graph.addNode(copy); graph.connect(prevNode, copy); prevNode = Collections.singletonList(copy); @@ -148,13 +148,11 @@ public class Visitador extends VoidVisitorAdapter { prevNode = Collections.singletonList(copy); } - // Visitador de expresiones - // Cada expresión encontrada genera un nodo en el CFG @Override public void visit(ExpressionStmt es, CFG graph) { graph.addNode(es); graph.connect(prevNode, es); - prevNode = Collections.singletonList((Node) es); + prevNode = Collections.singletonList(es); // Seguimos visitando... super.visit(es, graph);