Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 2050573003: Issue 26629. Detect cache inconsistency in GetContentTask. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | pkg/analyzer/lib/task/model.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 59c94c4f30cebb76df26f24cd4fa7e33730b02da..6c72f5c109aea451f9963d88e74884c84071ae3b 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -681,6 +681,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
CacheState state = entry.getState(descriptor);
if (state == CacheState.FLUSHED || state == CacheState.INVALID) {
driver.computeResult(target, descriptor);
+ entry = getCacheEntry(target);
}
state = entry.getState(descriptor);
if (state == CacheState.ERROR) {
@@ -728,7 +729,8 @@ class AnalysisContextImpl implements InternalAnalysisContext {
* to stand in for a real one if one does not exist
* facilitating creation a type provider without dart:async.
*/
- LibraryElement createMockAsyncLib(LibraryElement coreLibrary, Source asyncSource) {
+ LibraryElement createMockAsyncLib(
+ LibraryElement coreLibrary, Source asyncSource) {
InterfaceType objType = coreLibrary.getType('Object').type;
ClassElement _classElement(String typeName, [List<String> parameterNames]) {
@@ -1056,13 +1058,13 @@ class AnalysisContextImpl implements InternalAnalysisContext {
bool changed = newContents != originalContents;
if (newContents != null) {
if (changed) {
+ entry.modificationTime = _contentCache.getModificationStamp(source);
if (!analysisOptions.incremental ||
!_tryPoorMansIncrementalResolution(source, newContents)) {
// Don't compare with old contents because the cache has already been
// updated, and we know at this point that it changed.
_sourceChanged(source, compareWithOld: false);
}
- entry.modificationTime = _contentCache.getModificationStamp(source);
entry.setValue(CONTENT, newContents, TargetedResult.EMPTY_LIST);
} else {
entry.modificationTime = _contentCache.getModificationStamp(source);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | pkg/analyzer/lib/task/model.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698