HashMap<Source, TimestampedData<AnalysisError[]>> hintMap = task.getHintMap();
if (hintMap == null) {
synchronized (cacheLock) {
// We don't have any information about which sources to mark as invalid other than the library
// source.
SourceEntry sourceEntry = cache.get(librarySource);
if (sourceEntry == null) {
throw new ObsoleteSourceAnalysisException(librarySource);
} 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 generate hints for non-Dart file as a Dart file: "
+ librarySource.getFullName());
}
if (thrownException == null) {
thrownException = new AnalysisException(
"GenerateDartHintsTask returned a null hint map without throwing an exception: "
+ librarySource.getFullName());
}
DartEntryImpl dartCopy = ((DartEntry) sourceEntry).getWritableCopy();
dartCopy.recordHintErrorInLibrary(librarySource, thrownException);
cache.put(librarySource, dartCopy);
}
throw thrownException;
}
for (Map.Entry<Source, TimestampedData<AnalysisError[]>> entry : hintMap.entrySet()) {
Source unitSource = entry.getKey();
TimestampedData<AnalysisError[]> results = entry.getValue();
synchronized (cacheLock) {
SourceEntry sourceEntry = cache.get(unitSource);
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 parse non-Dart file as a Dart file: "