Closed feiwww closed 5 years ago
This might be due to ClassIndex :(
To avoid any problem if you know that you will be parsing Java files you can directly instantiate the good generator : new JdtGenerator().generateFromFile(file1);
Thanks for your reply. It's useful to me! I still a little question:
I see the content of MappingStore.toString(). It include type(number) and code/value that cant one-to-one match a node. but could you tell me how to get the precisely unmatched nodes ?
I think that you have to traverse both trees and try if the MappingStore has them. It would be nice to have an utility method for that.
I just compared two ast of Test.java in the paper Fine-grained and Accurate Source Code Differencing. MappingStore are as follows
[(34@@0,34@@0), (44@@,44@@), (15@@,15@@), (83@@public,83@@private), (55@@class,55@@class), (42@@i,42@@i), (83@@public,83@@public), (42@@Test,42@@Test), (39@@int,39@@int), (43@@String,43@@String), (8@@,8@@), (41@@,41@@), (31@@,31@@), (42@@foo,42@@foo), (45@@"Foo!",45@@"Foo!"), (27@@==,27@@==), (42@@String,42@@String), (42@@i,42@@i)]
The list may include the duplicate elements, so that I think I can't use it to find the unmatched node of the tree. could you please give me some points. Thank you.
What do you mean by duplicate elements?
emmm, for example, one tree could include more than one node 34@@0, how to know the position of this matched node in the first pair.
I think the better output of MappingStore(in toString() and iterator() Method) should be "type@value@(absolute position)" rather than "type@value". After that we usually use a unique value to represent node. Maybe, it's easy to solve it, and i am desired to ask for it in maven api. Thanks^-^
You're right! It will be the case in GumTree 3.0.
Great! Any schedule? looking forward to…
ASAP but we are redesigning several APIs so it's gonna take some time. Hopefully in May / June.
OK in last version of develop we have improved mapping store textual conversion. You can try it out and tell us what you think.
Thanks for your awesome code! I got some problems when want to use gumtree in my maven project. As the documentation I try to parse code or diff ast, but got "unhandled exception type IOException". Got "No generator found for file: myfile.java" when add throws declaration. Can you give me a few guidance?