]> git.uio.no Git - ifi-stolz-refaktor.git/blame - software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/change/SearchBasedExtractLocalVariableWithAssertsChanger.java
skeleton done!
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor / src / no / uio / ifi / refaktor / change / SearchBasedExtractLocalVariableWithAssertsChanger.java
CommitLineData
2d553c1f
AE
1package no.uio.ifi.refaktor.change;
2
3import org.eclipse.core.runtime.CoreException;
4import org.eclipse.core.runtime.IProgressMonitor;
5import org.eclipse.jdt.core.IMethod;
6
7import no.uio.ifi.refaktor.analyze.SearchBasedExtractLocalVariableAnalyzer;
8import no.uio.ifi.refaktor.analyze.analyzers.SearchBasedExtractAndMoveMethodAnalyzer;
df7eb88a
AE
9import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesExtractAndMoveCandidateComparator;
10import no.uio.ifi.refaktor.analyze.comparators.FavorNoUnfixesExtractLocalVariableCandidateComparator;
2d553c1f
AE
11import no.uio.ifi.refaktor.analyze.exceptions.RefaktorAnalyzerException;
12import no.uio.ifi.refaktor.change.changers.RefaktorChanger;
13import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor;
14import no.uio.ifi.refaktor.change.executors.ExtractLocalVariableExecutor;
15
16public class SearchBasedExtractLocalVariableWithAssertsChanger implements RefaktorChanger {
17 private SearchBasedExtractLocalVariableAnalyzer analyzer;
18
19 public SearchBasedExtractLocalVariableWithAssertsChanger(IMethod method) {
df7eb88a 20 this.analyzer = new SearchBasedExtractLocalVariableAnalyzer(method, new FavorNoUnfixesExtractLocalVariableCandidateComparator());
2d553c1f
AE
21 }
22
23 @Override
24 public void checkPreconditions() throws RefaktorAnalyzerException {
25 analyzer.analyze();
26
27 }
28
29 @Override
30 public void execute(IProgressMonitor monitor) throws CoreException {
31 ExtractLocalVariableExecutor executor = new ExtractLocalVariableExecutor(analyzer.getCandidate());
32 executor.execute(monitor);
33 }
34
35}