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

Side by Side Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 1831133005: Consolidate duplicate code for resloving URIs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Sort Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 import 'dart:io' as io; 1 import 'dart:io' as io;
2 2
3 import 'package:analyzer/dart/element/element.dart'; 3 import 'package:analyzer/dart/element/element.dart';
4 import 'package:analyzer/src/context/cache.dart'; 4 import 'package:analyzer/src/context/cache.dart';
5 import 'package:analyzer/src/context/context.dart'; 5 import 'package:analyzer/src/context/context.dart';
6 import 'package:analyzer/src/generated/engine.dart'; 6 import 'package:analyzer/src/generated/engine.dart';
7 import 'package:analyzer/src/generated/java_io.dart'; 7 import 'package:analyzer/src/generated/java_io.dart';
8 import 'package:analyzer/src/generated/resolver.dart'; 8 import 'package:analyzer/src/generated/resolver.dart';
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:analyzer/src/generated/source_io.dart'; 10 import 'package:analyzer/src/generated/source_io.dart';
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 UriKind get uriKind => UriKind.PACKAGE_URI; 156 UriKind get uriKind => UriKind.PACKAGE_URI;
157 157
158 @override 158 @override
159 bool operator ==(Object object) => 159 bool operator ==(Object object) =>
160 object is InSummarySource && object.uri == uri; 160 object is InSummarySource && object.uri == uri;
161 161
162 @override 162 @override
163 bool exists() => true; 163 bool exists() => true;
164 164
165 @override 165 @override
166 Uri resolveRelativeUri(Uri relativeUri) {
167 Uri baseUri = uri;
168 return baseUri.resolveUri(relativeUri);
169 }
170
171 @override
172 String toString() => uri.toString(); 166 String toString() => uri.toString();
173 } 167 }
174 168
175 /** 169 /**
176 * A [SummaryDataStore] is a container for the data extracted from a set of 170 * A [SummaryDataStore] is a container for the data extracted from a set of
177 * summary package bundles. It contains maps which can be used to find linked 171 * summary package bundles. It contains maps which can be used to find linked
178 * and unlinked summaries by URI. 172 * and unlinked summaries by URI.
179 */ 173 */
180 class SummaryDataStore { 174 class SummaryDataStore {
181 /** 175 /**
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 * also provides [summaryPath]. 246 * also provides [summaryPath].
253 */ 247 */
254 class _InSummaryFallbackSource extends FileBasedSource 248 class _InSummaryFallbackSource extends FileBasedSource
255 implements InSummarySource { 249 implements InSummarySource {
256 @override 250 @override
257 final String summaryPath; 251 final String summaryPath;
258 252
259 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath) 253 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath)
260 : super(file, uri); 254 : super(file, uri);
261 } 255 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698