For calculating duplication, I am parsing a java project into the AST.
But when trying to compare the AST nodes, Declaration attributes such as src
are compared too, which leads to the comparison failing.
This change was introduced < 1 year ago where Declaration annotations were removed.
To negate this I have to do the following:
myAst = visit(myAst) {
case node n : {
n.src = |unknown:///|;
}
}
And then compare the nodes.
Is there any other way to make comparing nodes easier?