AnalysisException thrownException = task.getException();
DartEntry dartEntry = null;
synchronized (cacheLock) {
SourceEntry sourceEntry = cache.get(unitSource);
if (sourceEntry == null) {
throw new ObsoleteSourceAnalysisException(unitSource);
} else if (!(sourceEntry instanceof DartEntry)) {
// This shouldn't be possible because we should never have performed the task if the source
// didn't represent a Dart file, but check to be safe.
throw new AnalysisException(
"Internal error: attempting to resolve non-Dart file as a Dart file: "