Index: pkg/analyzer/lib/src/string_source.dart |
diff --git a/pkg/analyzer/lib/src/string_source.dart b/pkg/analyzer/lib/src/string_source.dart |
index bfeedf091452c6a80c2ff12517b31823d868bd97..789e74c7990d3cf9ba754a60e4d449144033987e 100644 |
--- a/pkg/analyzer/lib/src/string_source.dart |
+++ b/pkg/analyzer/lib/src/string_source.dart |
@@ -4,8 +4,8 @@ |
library analyzer.string_source; |
-import 'generated/source.dart'; |
import 'generated/engine.dart' show TimestampedData; |
+import 'generated/source.dart'; |
/// An implementation of [Source] that's based on an in-memory Dart string. |
class StringSource implements Source { |
@@ -16,34 +16,35 @@ class StringSource implements Source { |
StringSource(this._contents, this.fullName) |
: modificationStamp = new DateTime.now().millisecondsSinceEpoch; |
- bool operator==(Object object) { |
- if (object is StringSource) { |
- StringSource ssObject = object; |
- return ssObject._contents == _contents && ssObject.fullName == fullName; |
- } |
- return false; |
- } |
+ TimestampedData<String> get contents => |
+ new TimestampedData(modificationStamp, _contents); |
- bool exists() => true; |
+ String get encoding => |
+ throw new UnsupportedError("StringSource doesn't support " "encoding."); |
- TimestampedData<String> get contents => new TimestampedData(modificationStamp, _contents); |
+ int get hashCode => _contents.hashCode ^ fullName.hashCode; |
- String get encoding => throw new UnsupportedError("StringSource doesn't support " |
- "encoding."); |
+ bool get isInSystemLibrary => false; |
String get shortName => fullName; |
- UriKind get uriKind => throw new UnsupportedError("StringSource doesn't support " |
- "uriKind."); |
+ @override |
+ Uri get uri => |
+ throw new UnsupportedError("StringSource doesn't support uri."); |
- int get hashCode => _contents.hashCode ^ fullName.hashCode; |
+ UriKind get uriKind => |
+ throw new UnsupportedError("StringSource doesn't support " "uriKind."); |
- bool get isInSystemLibrary => false; |
+ bool operator ==(Object object) { |
+ if (object is StringSource) { |
+ StringSource ssObject = object; |
+ return ssObject._contents == _contents && ssObject.fullName == fullName; |
+ } |
+ return false; |
+ } |
- @override |
- Uri get uri => throw new UnsupportedError( |
- "StringSource doesn't support uri."); |
+ bool exists() => true; |
- Uri resolveRelativeUri(Uri relativeUri) => throw new UnsupportedError( |
- "StringSource doesn't support resolveRelative."); |
+ Uri resolveRelativeUri(Uri relativeUri) => |
+ throw new UnsupportedError("StringSource doesn't support resolveRelative."); |
} |