import no.uio.ifi.refaktor.analyze.ExtractAndMoveMethodAnalysisResult;
import no.uio.ifi.refaktor.analyze.analyzers.CompilationUnitWideExtractAndMoveMethodAnalyzer;
+import no.uio.ifi.refaktor.analyze.analyzers.ExtractAndMoveMethodAnalyzer;
import no.uio.ifi.refaktor.analyze.analyzers.SearchBasedExtractAndMoveMethodAnalyzer;
import no.uio.ifi.refaktor.analyze.analyzers.TypeWideExtractAndMoveMethodAnalyzer;
import no.uio.ifi.refaktor.change.executors.ExtractAndMoveMethodExecutor;
private int extractAndMoveMethodResultFoundCount;
private int extractAndMoveMethodResultNotFoundCount;
private int extractAndMoveMethodResultGeneratedCount;
+ private int selectionsAnalyzedCount;
private Statistics() {
startTime = System.currentTimeMillis();
notPerformedRefactorings = new HashMap<String, Integer>();
extractAndMoveMethodExecutedCount = extractAndMoveMethodNotExecutedCount = 0;
extractAndMoveMethodResultFoundCount = extractAndMoveMethodResultNotFoundCount = 0;
- extractAndMoveMethodResultGeneratedCount = 0;
+ extractAndMoveMethodResultGeneratedCount = selectionsAnalyzedCount = 0;
snapshotTimeSinceStart = timeSinceStart();
}
this.extractAndMoveMethodResultFoundCount = statistics.extractAndMoveMethodResultFoundCount;
this.extractAndMoveMethodResultNotFoundCount = statistics.extractAndMoveMethodResultNotFoundCount;
this.extractAndMoveMethodResultGeneratedCount = statistics.extractAndMoveMethodResultGeneratedCount;
+ this.selectionsAnalyzedCount = statistics.selectionsAnalyzedCount;
this.snapshotTimeSinceStart = timeSinceStart();
}
+ (compilationUnitCount > 0 ? "\nNumber of compilation units analyzed: " + compilationUnitCount : "")
+ (typeCount > 0 ? "\nNumber of types analyzed: " + typeCount : "")
+ "\nNumber of methods analyzed: " + methodCount
+ + "\nNumber of text selections analyzed: " + selectionsAnalyzedCount
+ "\n\n" + extractAndMoveMethodResultFoundCount
+ " methods are chosen as candidates for the Extract and Move Method refactoring, while "
+ extractAndMoveMethodResultNotFoundCount + " are not"
this.statistics = new Statistics();
}
+ pointcut selectionAnalyze() : call(* ExtractAndMoveMethodAnalyzer.analyze()) ;
pointcut methodAnalyze(SearchBasedExtractAndMoveMethodAnalyzer analyzer) :
call(* SearchBasedExtractAndMoveMethodAnalyzer.analyze()) && target(analyzer);
pointcut typeAnalyze() : call(* TypeWideExtractAndMoveMethodAnalyzer.analyze());
call(* RefactoringPerformer+.performRefactoring(Refactoring)) && args(refactoring);
pointcut extractAndMoveExecuted() : call(* ExtractAndMoveMethodExecutor.execute(..));
pointcut analysisResultCreated() : call(public ExtractAndMoveMethodAnalysisResult.new(..));
+
+ after() : selectionAnalyze() {
+ statistics.selectionsAnalyzedCount++;
+ }
after(SearchBasedExtractAndMoveMethodAnalyzer analyzer) : methodAnalyze(analyzer) {
statistics.methodCount++;