1 package no.uio.ifi.refaktor.change;
3 import org.eclipse.core.runtime.CoreException;
4 import org.eclipse.core.runtime.IProgressMonitor;
5 import org.eclipse.jdt.core.IMethod;
7 import no.uio.ifi.refaktor.analyze.SearchBasedExtractLocalVariableAnalyzer;
8 import no.uio.ifi.refaktor.analyze.analyzers.SearchBasedExtractAndMoveMethodAnalyzer;
9 import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesCandidateComparator;
10 import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException;
11 import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
12 import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor;
13 import no.uio.ifi.refaktor.change.executors.ExtractLocalVariableExecutor;
15 public class SearchBasedExtractLocalVariableWithAssertsChanger implements RefaktorChanger {
16 private SearchBasedExtractLocalVariableAnalyzer analyzer;
18 public SearchBasedExtractLocalVariableWithAssertsChanger(IMethod method) {
19 this.analyzer = new SearchBasedExtractLocalVariableAnalyzer(method, new FavorNoUnfixesCandidateComparator());
23 public void checkPreconditions() throws RefaktorAnalyzerException {
29 public void execute(IProgressMonitor monitor) throws CoreException {
30 ExtractLocalVariableExecutor executor = new ExtractLocalVariableExecutor(analyzer.getCandidate());
31 executor.execute(monitor);