*/
private DartEntry recordResolveDartUnitTaskResults(ResolveDartUnitTask task)
throws AnalysisException {
Source unitSource = task.getSource();
Source librarySource = task.getLibrarySource();
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: "
+ unitSource.getFullName());
}
dartEntry = (DartEntry) sourceEntry;
long sourceTime = getModificationStamp(unitSource);
long resultTime = task.getModificationTime();
if (sourceTime == resultTime) {
if (dartEntry.getModificationTime() != sourceTime) {
// The source has changed without the context being notified. Simulate notification.
sourceChanged(unitSource);
dartEntry = getReadableDartEntry(unitSource);
if (dartEntry == null) {
throw new AnalysisException("A Dart file became a non-Dart file: "
+ unitSource.getFullName());
}
}
DartEntryImpl dartCopy = dartEntry.getWritableCopy();
if (thrownException == null) {