Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such method #5

Closed
CharleyBrown99 opened this issue Feb 23, 2019 · 5 comments
Closed

No such method #5

CharleyBrown99 opened this issue Feb 23, 2019 · 5 comments

Comments

@CharleyBrown99
Copy link

I've been trying to do the example but it doesn't work, i get an internal error.
Here is the log :
0 [main] INFO refdiff.core.util.GitServiceImpl - Checking out A:\Ecole\Session11\LOG530\jersey d94ca2b27c9e8a5fa9fe19483d58d2f2ef024606 ...
2887 [main] INFO refdiff.core.rm2.analysis.GitHistoryStructuralDiffAnalyzer - Analyzing code after (d94ca2b27c9e8a5fa9fe19483d58d2f2ef024606) ...
3628 [main] INFO refdiff.core.util.GitServiceImpl - Checking out A:\Ecole\Session11\LOG530\jersey 526599a8e2110f3ffb50c12294f5b7e4cd13b0b6 ...
5916 [main] INFO refdiff.core.rm2.analysis.GitHistoryStructuralDiffAnalyzer - Analyzing code before (526599a8e2110f3ffb50c12294f5b7e4cd13b0b6) ...
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.jgit.revwalk.RevWalk.close()V
at refdiff.core.rm2.analysis.GitHistoryStructuralDiffAnalyzer.detectAtCommit(GitHistoryStructuralDiffAnalyzer.java:106)
at refdiff.core.RefDiff.detectAtCommit(RefDiff.java:64)
at application.Analyser.analyseRepo(Analyser.java:17)
at application.Application.main(Application.java:10)

And here is the code :
`public class Analyser {

public static List<SDRefactoring> analyseRepo(String repoURL,String localRepoLocation) throws Exception{
    RefDiff refDiff = new RefDiff();
    GitService gitService = new GitServiceImpl();
    Repository repository = gitService.cloneIfNotExists(localRepoLocation,repoURL);
    List<SDRefactoring> refactorings = refDiff.detectAtCommit(repository, "d94ca2b27c9e8a5fa9fe19483d58d2f2ef024606");
    return refactorings;
}

}`
But the code doesn't even get to the return. Is there an error in my code or the problem resides in the RefDiff ?

@danilofes
Copy link
Collaborator

I'm not able to replicate this problem. Which version of Java are you using?

@CharleyBrown99
Copy link
Author

CharleyBrown99 commented Feb 25, 2019

i use JDK 1.8 or more precisely, java version 1.8.0_60. I also use IntlliJ has the IDE.

Thank you for answering

@CharleyBrown99
Copy link
Author

CharleyBrown99 commented Feb 26, 2019

I found the problem. In the version 0.1.1, RevWalk does not implement AutoCloseable. Is there a newer version on the maven ? Here is my maven right now
<dependency> <groupId>com.github.aserg-ufmg</groupId> <artifactId>refdiff-core</artifactId> <version>0.1.1</version> </dependency>

@danilofes
Copy link
Collaborator

RevWalk is a class from the library org.eclipse.jgit. Note that refdiff-core 0.1.1 depends on jgit version 4.7.0.201704051617-r and it does implement AutoCloseable in this version. Can you check which version of jgit is in your classpath? Maybe your pom.xml is forcing a different version for some reason.

@danilofes
Copy link
Collaborator

I'm closing this issue as I'm not sure it is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants