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(); }