Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong edit scripts #235

Open
zqxyus opened this issue Mar 3, 2022 · 8 comments
Open

Wrong edit scripts #235

zqxyus opened this issue Mar 3, 2022 · 8 comments

Comments

@zqxyus
Copy link

zqxyus commented Mar 3, 2022

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

@algomaster99
Copy link
Member

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?

@zqxyus
Copy link
Author

zqxyus commented Mar 3, 2022

@algomaster99
Copy link
Member

algomaster99 commented Mar 29, 2022

@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.

@algomaster99
Copy link
Member

One more instance of this bug. Redundant insertion and deletion of SUPER_TYPE is being reported.

@xzm2000
Copy link

xzm2000 commented Apr 5, 2022

@algomaster99 I have the same problem, especially in the TypeReference, which usually have extra insert and delete operation

@algomaster99
Copy link
Member

@xzm2000 could you please provide test cases? It will be helpful while I debug it.

@xzm2000
Copy link

xzm2000 commented Apr 8, 2022

@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

@algomaster99
Copy link
Member

There could ve a bug in gumtree as well. I will investigate when I get time. Thanks for the test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants