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

Side by Side Diff: pkg/analyzer/lib/src/context/source.dart

Issue 2683043002: Ensure that returned cached source have the same actual URI. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.context.source; 5 library analyzer.src.context.source;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/exception/exception.dart'; 10 import 'package:analyzer/exception/exception.dart';
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 if (packageUri != null) { 250 if (packageUri != null) {
251 // Ensure scheme is set. 251 // Ensure scheme is set.
252 if (packageUri.scheme == '') { 252 if (packageUri.scheme == '') {
253 packageUri = packageUri.replace(scheme: 'file'); 253 packageUri = packageUri.replace(scheme: 'file');
254 } 254 }
255 containedUri = packageUri; 255 containedUri = packageUri;
256 } 256 }
257 } 257 }
258 258
259 return _absoluteUriToSourceCache.putIfAbsent(containedUri, () { 259 return _absoluteUriToSourceCache.putIfAbsent(actualUri, () {
260 for (UriResolver resolver in resolvers) { 260 for (UriResolver resolver in resolvers) {
261 Source result = resolver.resolveAbsolute(containedUri, actualUri); 261 Source result = resolver.resolveAbsolute(containedUri, actualUri);
262 if (result != null) { 262 if (result != null) {
263 return result; 263 return result;
264 } 264 }
265 } 265 }
266 return null; 266 return null;
267 }); 267 });
268 } 268 }
269 } 269 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698