]> git.uio.no Git - ifi-stolz-refaktor.git/blame - software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/change/changers/SearchBasedExtractAndMoveMethodChanger.java
ExtractAndMoveMethodAnalysisResult: renaming to ExtractAndMoveMethodCandidate
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor / src / no / uio / ifi / refaktor / change / changers / SearchBasedExtractAndMoveMethodChanger.java
CommitLineData
2b4a9262 1package no.uio.ifi.refaktor.change.changers;
49214add 2
33b364ef 3import no.uio.ifi.refaktor.analyze.analyzers.SearchBasedExtractAndMoveMethodAnalyzer;
7fa217a1 4import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesCandidateComparator;
c847e15b 5import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException;
08f060c3 6import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor;
37be5000 7
49214add
EK
8import org.eclipse.core.runtime.CoreException;
9import org.eclipse.core.runtime.IProgressMonitor;
37be5000 10import org.eclipse.core.runtime.NullProgressMonitor;
0a865b44 11import org.eclipse.jdt.core.IMethod;
49214add
EK
12
13public class SearchBasedExtractAndMoveMethodChanger implements RefaktorChanger {
14
37be5000 15 private SearchBasedExtractAndMoveMethodAnalyzer analyzer;
0a865b44
EK
16
17 public SearchBasedExtractAndMoveMethodChanger(IMethod method) {
7fa217a1 18 this.analyzer = new SearchBasedExtractAndMoveMethodAnalyzer(method, new FavorNoUnfixesCandidateComparator());
0a865b44
EK
19 }
20
49214add 21 @Override
c847e15b 22 public void checkPreconditions() throws RefaktorAnalyzerException {
37be5000 23 analyzer.analyze();
49214add
EK
24 }
25
26 @Override
a554b0ce 27 public void execute(IProgressMonitor monitor) throws CoreException {
7fa217a1 28 ExtractAndMoveMethodExecutor executor = new ExtractAndMoveMethodExecutor(analyzer.getCandidate());
96b66186 29 executor.execute(new NullProgressMonitor());
49214add
EK
30 }
31
32}