GumTreeDiff / gumtree

An awesome code differencing tool
https://github.com/GumTreeDiff/gumtree/wiki
GNU Lesser General Public License v3.0
936 stars 174 forks source link

seems confused edit script #279

Closed xzm2000 closed 1 year ago

xzm2000 commented 2 years ago

Hi! I am confused by the edit script in these two java files by gumtree-simple. (Because github can only upload .txt, I changed the name from .java to .txt) old.txt new.txt

My command is: gumtree webdiff old.java new.java -m gumtree-simple I didn't use gumtree because the unexpected change for public class KeyedObjects2D

The result is a little confused, why move and delete here?

image
jrfaller commented 1 year ago

Thanks for the report. It's due to a corner-case where there is only one candidate block and the default similarity threshold is too low by default (a little too optimistic I realize for these cases). It no longer does it when setting a larger value : gumtree webdiff old.java new.java -m gumtree-simple -M bu_minsim 0.5