gui.RunWithTwoDirectories Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refactoring-miner Show documentation
Show all versions of refactoring-miner Show documentation
RefactoringMiner is a library/API written in Java that can detect refactorings applied in the history of a Java project.
package gui;
import gui.webdiff.WebDiff;
import org.refactoringminer.api.Refactoring;
import org.refactoringminer.astDiff.models.ProjectASTDiff;
import org.refactoringminer.rm1.GitHistoryRefactoringMinerImpl;
import java.io.IOException;
import java.nio.file.Path;
public class RunWithTwoDirectories {
public static void main(String[] args) throws IOException {
final String projectRoot = "/home/tsantalis/eclipse-workspace/RefactoringMiner";
//final String projectRoot = "/home/tsantalis/eclipse-workspace/RefactoringMiner/src/test/resources/oracle/commits/defects4j";
String folder1 = projectRoot + "/tmp/v1/DataStream.java";
String folder2 = projectRoot + "/tmp/v2/DataStream.java";
//String folder1 = projectRoot + "/tmp/jabRef/v1/";
//String folder2 = projectRoot + "/tmp/jabRef/v2/";
ProjectASTDiff projectASTDiff = new GitHistoryRefactoringMinerImpl().diffAtDirectories(Path.of(folder1), Path.of(folder2));
for(Refactoring r: projectASTDiff.getRefactorings()) {
System.out.println(r);
}
new WebDiff(projectASTDiff).run();
}
}