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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 845813006: When the file content is the same as the being removed overlay contents, ignore the change. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 173735221af803dc8873784685a3a38a83ec1ed8..75ec85de4154bd40fe5f33d971f997071ee0c2b3 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -3215,8 +3215,23 @@ class AnalysisContextImpl implements InternalAnalysisContext {
} else if (originalContents != null) {
_incrementalAnalysisCache =
IncrementalAnalysisCache.clear(_incrementalAnalysisCache, source);
- _sourceChanged(source);
- changed = true;
+ String newContents;
+ try {
+ newContents = getContents(source).data;
+ if (newContents == originalContents) {
+ SourceEntry sourceEntry = _cache.get(source);
+ if (sourceEntry != null) {
Brian Wilkerson 2015/01/13 19:45:37 We should get the source entry before reading, bec
scheglov 2015/01/13 20:01:57 Done.
+ sourceEntry.modificationTime = getModificationStamp(source);
Brian Wilkerson 2015/01/13 19:45:37 We should cache the content in the entry, and we s
scheglov 2015/01/13 20:01:57 Done.
+ }
+ } else {
+ changed = true;
+ }
+ } catch (e) {
+ changed = true;
+ }
+ if (changed) {
+ _sourceChanged(source);
+ }
}
return changed;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698