IAnalysisEngine<ClassDescriptor, E> engine = (IAnalysisEngine<ClassDescriptor, E>) classAnalysisEngineMap
.get(analysisClass);
if (engine == null) {
throw new IllegalArgumentException("No analysis engine registered to produce " + analysisClass.getName());
}
Profiler profiler = getProfiler();
// Perform the analysis
try {
profiler.start(engine.getClass());
analysisResult = engine.analyze(this, classDescriptor);
// If engine returned null, we need to construct
// an AbnormalAnalysisResult object to record that fact.
// Otherwise we will try to recompute the value in
// the future.
if (analysisResult == null) {
analysisResult = NULL_ANALYSIS_RESULT;
}
} catch (CheckedAnalysisException e) {
// Exception - make note
// Andrei: e.getStackTrace() cannot be null, but getter clones
// the stack...
// if (e.getStackTrace() == null)
// e.fillInStackTrace();
analysisResult = new AbnormalAnalysisResult(e);
} catch (RuntimeException e) {
// Exception - make note
// Andrei: e.getStackTrace() cannot be null, but getter clones
// the stack...
// if (e.getStackTrace() == null)
// e.fillInStackTrace();
analysisResult = new AbnormalAnalysisResult(e);
} finally {
profiler.end(engine.getClass());
}
// Save the result
descriptorMap.put(classDescriptor, analysisResult);
}