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

Unified Diff: pkg/analyzer/lib/src/source/source_resource.dart

Issue 2245133005: Convert resource providers to use FileSource (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix missed reference Created 4 years, 4 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 | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/source/source_resource.dart
diff --git a/pkg/analyzer/lib/src/source/source_resource.dart b/pkg/analyzer/lib/src/source/source_resource.dart
index 5de7f77e6966b1eb32fc3c27221a1d74bf9c8134..2d188d8be410b8df81379f570d1c9afeec57d6af 100644
--- a/pkg/analyzer/lib/src/source/source_resource.dart
+++ b/pkg/analyzer/lib/src/source/source_resource.dart
@@ -84,7 +84,7 @@ class FileSource extends Source {
*/
TimestampedData<String> get contentsFromFile {
return new TimestampedData<String>(
- file.modificationStamp, fileReadMode(file.readAsStringSync()));
+ modificationStamp, fileReadMode(file.readAsStringSync()));
}
@override
@@ -94,13 +94,19 @@ class FileSource extends Source {
String get fullName => _absolutePath ??= file.path;
@override
- int get hashCode => id;
+ int get hashCode => uri.hashCode;
@override
bool get isInSystemLibrary => uri.scheme == DartUriResolver.DART_SCHEME;
@override
- int get modificationStamp => file.modificationStamp;
+ int get modificationStamp {
+ try {
+ return file.modificationStamp;
+ } on FileSystemException {
+ return -1;
+ }
+ }
@override
String get shortName => file.shortName;
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698