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

Unified Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 2829493002: Make conflicting summary check configurable (Closed)
Patch Set: Created 3 years, 8 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/test/src/summary/package_bundle_reader_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/package_bundle_reader.dart
diff --git a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
index 1e443ede7d5842a2ed517e83f544fe0fce2d108a..04d21bdb6ace2a5d140a503d8bc4c954b82fc9df 100644
--- a/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary/package_bundle_reader.dart
@@ -398,14 +398,22 @@ class SummaryDataStore {
final Iterable<String> _summaryPaths;
/**
+ * If true, do not accept multiple summaries that contain the same Dart uri.
+ */
+ bool _disallowOverlappingSummaries;
+
+ /**
* Create a [SummaryDataStore] and populate it with the summaries in
* [summaryPaths]. If [recordDependencyInfo] is `true`, record
* [PackageDependencyInfo] for each summary, for later access via
* [dependencies].
*/
SummaryDataStore(Iterable<String> summaryPaths,
- {bool recordDependencyInfo: false, ResourceProvider resourceProvider})
+ {bool recordDependencyInfo: false,
+ bool disallowOverlappingSummaries: false,
+ ResourceProvider resourceProvider})
: _summaryPaths = summaryPaths,
+ _disallowOverlappingSummaries = disallowOverlappingSummaries,
dependencies =
recordDependencyInfo ? <PackageDependencyInfoBuilder>[] : null {
summaryPaths.forEach((String path) => _fillMaps(path, resourceProvider));
@@ -441,7 +449,8 @@ class SummaryDataStore {
}
for (int i = 0; i < bundle.unlinkedUnitUris.length; i++) {
String uri = bundle.unlinkedUnitUris[i];
- if (uriToSummaryPath.containsKey(uri) &&
+ if (_disallowOverlappingSummaries &&
+ uriToSummaryPath.containsKey(uri) &&
(uriToSummaryPath[uri] != path)) {
throw new ConflictingSummaryException(
_summaryPaths, uri, uriToSummaryPath[uri], path);
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/package_bundle_reader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698