Replies: 2 comments 1 reply
|
Hi! I am afraid but (converted to Java) this code works for me. Maybe this is a class path issue? How do you launch the program? |
1 reply
|
I recommend using the last version 4.0.0-beta3. The external dependencies are not required in order to diff Java code. The error indicates that GumTree's registry is not able to retrieve the default diff algorithm and instead return a null value. Using GumTree it's unfortunately impossible to convert back ASTs to source code. However there is https://mvnrepository.com/artifact/fr.inria.gforge.spoon.labs/gumtree-spoon-ast-diff which is specially done for this purpose. Cheers! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello, I am getting the following error for the matcher. Basically the matcher could not use because I did not register a matcher?
Cannot invoke "com.github.gumtreediff.utils.Registry$Factory.instantiate(Object[])" because "this.defaultMatcherFactory" is null java.lang.NullPointerException: Cannot invoke "com.github.gumtreediff.utils.Registry$Factory.instantiate(Object[])" because "this.defaultMatcherFactory" is nullThis is my code, which is just taken from Wiki.
Run.initGenerators();val srcFile = "src/test/kotlin/data/Duke.java"val dstFile = "src/test/kotlin/data/Command.java"val src: Tree = TreeGenerators.getInstance().getTree(srcFile).root // retrieves and applies the default parser for the fileval dst: Tree = TreeGenerators.getInstance().getTree(dstFile).root // retrieves and applies the default parser for the fileval defaultMatcher = Matchers.getInstance().getMatcher() // retrieves the default matcherval mappings: MappingStore = defaultMatcher.match(src, dst) // computes the mappings between the treesHope someone could kindly help me out. Much appreciated!
All reactions