1 package no.uio.ifi.refaktor.change.changers;
3 import no.uio.ifi.refaktor.analyze.analyzers.SearchBasedExtractAndMoveMethodAnalyzer;
4 import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesCandidateComparator;
5 import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException;
6 import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor;
8 import org.eclipse.core.runtime.CoreException;
9 import org.eclipse.core.runtime.IProgressMonitor;
10 import org.eclipse.core.runtime.NullProgressMonitor;
11 import org.eclipse.jdt.core.IMethod;
13 public class SearchBasedExtractAndMoveMethodChanger implements RefaktorChanger {
15 private SearchBasedExtractAndMoveMethodAnalyzer analyzer;
17 public SearchBasedExtractAndMoveMethodChanger(IMethod method) {
18 this.analyzer = new SearchBasedExtractAndMoveMethodAnalyzer(method, new FavorNoUnfixesCandidateComparator());
22 public void checkPreconditions() throws RefaktorAnalyzerException {
27 public void execute(IProgressMonitor monitor) throws CoreException {
28 ExtractAndMoveMethodExecutor executor = new ExtractAndMoveMethodExecutor(analyzer.getCandidate());
29 executor.execute(new NullProgressMonitor());