RefDiff
RefDiff copied to clipboard
Exception in running C language
Hi RefDiff Team,
I've been facing an issue while running and mining C project.
The code:
CPlugin cPlugin = new CPlugin();
RefDiff refDiffC = new RefDiff(cPlugin);
File gitRepo = refDiffC.cloneGitRepository(
new File(tempFolder, "htop"),
"https://github.com/htop-dev/htop.git");
printRefactorings(
"Refactorings found in:",
refDiffC.computeDiffForCommit(gitRepo, "0750ff7e76d845a70749cc00fa25dbe98a7147a1"));
The exception:
Exception in thread "main" java.lang.RuntimeException: java.lang.SecurityException: class "org.eclipse.cdt.internal.core.dom.parser.c.GNUCASTGotoStatement"'s signer information does not match signer information of other classes in the same package
at refdiff.core.diff.CstComparator.compare(CstComparator.java:55)
at refdiff.core.diff.CstComparator.compare(CstComparator.java:39)
at refdiff.core.RefDiff.computeDiffForCommit(RefDiff.java:58)
at refdiff.examples.CTest.runExamples(CTest.java:34)
at refdiff.examples.CTest.main(CTest.java:15)
Caused by: java.lang.SecurityException: class "org.eclipse.cdt.internal.core.dom.parser.c.GNUCASTGotoStatement"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at refdiff.parsers.c.CCstVisitor.shouldSkip(CCstVisitor.java:337)
at refdiff.parsers.c.CCstVisitor.genericVisit(CCstVisitor.java:106)
at org.eclipse.cdt.core.dom.ast.ASTGenericVisitor.visit(ASTGenericVisitor.java:123)
at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:257)
at refdiff.parsers.c.CPlugin.parse(CPlugin.java:47)
at refdiff.core.diff.CstComparator$DiffBuilder.
I think it would be solved by a jar file. I've tried to check all possible jars but still no one effect on parsing.
Similar but not the same exception when running the C part of RefDiffExample.java:
> Task :refdiff-example:RefDiffExample.main() FAILED
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/cdt/core/dom/ast/ASTVisitor
at refdiff.examples.RefDiffExample.runExamples(RefDiffExample.java:49)
at refdiff.examples.RefDiffExample.main(RefDiffExample.java:15)
Caused by: java.lang.ClassNotFoundException: org.eclipse.cdt.core.dom.ast.ASTVisitor
Caused by: java.lang.ClassNotFoundException: org.eclipse.cdt.core.dom.ast.ASTVisitor
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 2 more
Execution failed for task ':refdiff-example:RefDiffExample.main()'.
> Process 'command '/Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Similar but not the same exception when running the C part of RefDiffExample.java:
> Task :refdiff-example:RefDiffExample.main() FAILED Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/cdt/core/dom/ast/ASTVisitor at refdiff.examples.RefDiffExample.runExamples(RefDiffExample.java:49) at refdiff.examples.RefDiffExample.main(RefDiffExample.java:15) Caused by: java.lang.ClassNotFoundException: org.eclipse.cdt.core.dom.ast.ASTVisitor Caused by: java.lang.ClassNotFoundException: org.eclipse.cdt.core.dom.ast.ASTVisitor at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 2 more Execution failed for task ':refdiff-example:RefDiffExample.main()'. > Process 'command '/Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java'' finished with non-zero exit value 1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
I have solved my issue by commenting implementation 'com.github.aserg-ufmg:refdiff-c:2.0.0'
and uncommentting "implementation project(':refdiff-c')" in build.gradle. Now I can run it for the git repo.