gumtree-spoon-ast-diff
gumtree-spoon-ast-diff copied to clipboard
Wrong edit scripts
When applying gumtree-spoon-ast diff to extract the edit scripts between buggy file and fixed one in Defects4j Chart 14, the edit scripts returned have some wrong or meaningless edit script. Specifically, when using gun diff , its result is xy@xy-ThinkStation-P320:~/defects/chart/chart_14_buggy$ diff source/org/jfree/chart/plot/CategoryPlot.java ../chart_14_fix/source/org/jfree/chart/plot/CategoryPlot.java 2165a2166,2168
if (markers == null) { return false; }
2446a2450,2452
} if (markers == null) { return false;
However, gumtree-spoon-ast-diff gives the following edit scripts:
Delete TypeReference at org.jfree.chart.plot.XYPlot:277 org.jfree.chart.plot.Plot Insert TypeReference at org.jfree.chart.plot.XYPlot:277 org.jfree.chart.plot.Plot Insert If at org.jfree.chart.plot.XYPlot:2293 if (markers == null) { return false; } Insert If at org.jfree.chart.plot.XYPlot:2532 if (markers == null) { return false; }
Hi @xy-whu ! Thank you for the potential bug report. It is a bit unclear to me diff of which two files are being computed here. Could you please share the link of the commit or the pull request where the two files can be found?
file links: https://github.com/program-repair/defects4j-dissection/commit/d7b7936
@xy-whu I am sorry I am reverting to this quite late. I completely missed this issue and forgot to follow-up on your comment.
The edit script is indeed a bit weird with the redundant deletion and insertion of TypeReference
. I do not have the time to fix this right now, but I will keep this on my to-do list. If your purpose is still pending, I would recommend you to try out https://github.com/GumTreeDiff/gumtree which is much more stable than this project.
One more instance of this bug. Redundant insertion and deletion of SUPER_TYPE
is being reported.
@algomaster99 I have the same problem, especially in the TypeReference
, which usually have extra insert and delete operation
@xzm2000 could you please provide test cases? It will be helpful while I debug it.
@xzm2000 could you please provide test cases? It will be helpful while I debug it.
I don't know whether it's a bug, because https://github.com/GumTreeDiff/gumtree gives the same result, has extra operation(insert and delete). I will upload the test case soon
There could ve a bug in gumtree as well. I will investigate when I get time. Thanks for the test cases.