From f1ecdfaf598bc52b843fec9589284ef4ed8b87b3 Mon Sep 17 00:00:00 2001 From: HuangYuyang Date: Tue, 6 Apr 2021 16:59:47 +0100 Subject: [PATCH] fix: stop popping trees if node has null range --- .../github/gumtreediff/gen/javaparser/JavaParserVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen.javaparser/src/main/java/com/github/gumtreediff/gen/javaparser/JavaParserVisitor.java b/gen.javaparser/src/main/java/com/github/gumtreediff/gen/javaparser/JavaParserVisitor.java index ec0d5eaa1..c355a2cf0 100644 --- a/gen.javaparser/src/main/java/com/github/gumtreediff/gen/javaparser/JavaParserVisitor.java +++ b/gen.javaparser/src/main/java/com/github/gumtreediff/gen/javaparser/JavaParserVisitor.java @@ -58,7 +58,7 @@ public TreeContext getTreeContext() { public void visitPreOrder(Node node) { process(node); new ArrayList<>(node.getChildNodes()).forEach(this::visitPreOrder); - if (trees.size() > 0) + if (trees.size() > 0 && node.getRange().isPresent()) trees.pop(); }