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? |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
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 null
This 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 file
val dst: Tree = TreeGenerators.getInstance().getTree(dstFile).root // retrieves and applies the default parser for the file
val defaultMatcher = Matchers.getInstance().getMatcher() // retrieves the default matcher
val mappings: MappingStore = defaultMatcher.match(src, dst) // computes the mappings between the trees
Hope someone could kindly help me out. Much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions