Deprecate Source.modificationStamp

Change-Id: Id7f361beff1c4e3f9edc743c58cce7888d330c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2021-11-19 19:33:07 +00:00 committed by commit-bot@chromium.org
parent f9d737b07a
commit d6d45d96f8
7 changed files with 9 additions and 1 deletions

View file

@ -5,6 +5,7 @@
* Deprecated `UriResolver.restoreAbsolute`, use `pathToUri` instead.
* Deprecated `SourceFactory.restoreAbsolute`, use `pathToUri` instead.
* Deprecated `UriKind` and `Source.uriKind`.
* Deprecated `Source.modificationStamp`.
* Fixed #47715.
## 2.7.0

View file

@ -106,6 +106,7 @@ class NonExistingSource extends Source {
@override
bool get isInSystemLibrary => false;
@Deprecated('Not used anymore')
@override
int get modificationStamp => -1;
@ -204,6 +205,7 @@ abstract class Source {
/// Clients should consider using the method
/// [AnalysisContext.getModificationStamp] because contexts can have local
/// overrides of the content of a source that the source is not aware of.
@Deprecated('Not used anymore')
int get modificationStamp;
/// Return a short version of the name that can be displayed to the user to

View file

@ -65,7 +65,7 @@ class FileSource extends Source {
/// See [contents].
TimestampedData<String> get contentsFromFile {
return TimestampedData<String>(
modificationStamp, fileReadMode(file.readAsStringSync()));
file.modificationStamp, fileReadMode(file.readAsStringSync()));
}
@Deprecated('Not used anymore')
@ -81,6 +81,7 @@ class FileSource extends Source {
@override
bool get isInSystemLibrary => uri.scheme == DartUriResolver.DART_SCHEME;
@Deprecated('Not used anymore')
@override
int get modificationStamp {
try {

View file

@ -72,6 +72,7 @@ class InSummarySource extends BasicSource {
@override
TimestampedData<String> get contents => TimestampedData<String>(0, '');
@Deprecated('Not used anymore')
@override
int get modificationStamp => 0;

View file

@ -216,6 +216,7 @@ class MemoryFileSourceNotExistingTest extends BaseTest {
expect(source.fullName, sourcePath);
}
@Deprecated('Not used anymore')
test_modificationStamp() {
expect(source.modificationStamp, -1);
}

View file

@ -471,6 +471,7 @@ class TestSource extends Source {
return false;
}
@Deprecated('Not used anymore')
@override
int get modificationStamp =>
generateExceptionOnRead ? -1 : _modificationStamp;

View file

@ -169,6 +169,7 @@ class MockSource implements Source {
@override
bool get isInSystemLibrary => false;
@Deprecated('Not used anymore')
@override
int get modificationStamp => 0;