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

Side by Side Diff: pkg/analyzer/lib/src/generated/source_io.dart

Issue 1296653003: Fix most implementations of UriResolver.restoreAbsolute. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.source.io; 5 library engine.source.io;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'engine.dart'; 9 import 'engine.dart';
10 import 'java_core.dart'; 10 import 'java_core.dart';
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 Source resolveAbsolute(Uri uri, [Uri actualUri]) { 276 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
277 if (!isFileUri(uri)) { 277 if (!isFileUri(uri)) {
278 return null; 278 return null;
279 } 279 }
280 return new FileBasedSource( 280 return new FileBasedSource(
281 new JavaFile.fromUri(uri), actualUri != null ? actualUri : uri); 281 new JavaFile.fromUri(uri), actualUri != null ? actualUri : uri);
282 } 282 }
283 283
284 @override 284 @override
285 Uri restoreAbsolute(Source source) { 285 Uri restoreAbsolute(Source source) {
286 if (source is FileBasedSource) { 286 return new Uri.file(source.fullName);
287 return new Uri.file(source.fullName);
288 }
289 return null;
290 } 287 }
291 288
292 /** 289 /**
293 * Return `true` if the given URI is a `file` URI. 290 * Return `true` if the given URI is a `file` URI.
294 * 291 *
295 * @param uri the URI being tested 292 * @param uri the URI being tested
296 * @return `true` if the given URI is a `file` URI 293 * @return `true` if the given URI is a `file` URI
297 */ 294 */
298 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; 295 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
299 } 296 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 550 }
554 551
555 /** 552 /**
556 * Return `true` if the given URI is a `file` URI. 553 * Return `true` if the given URI is a `file` URI.
557 * 554 *
558 * @param uri the URI being tested 555 * @param uri the URI being tested
559 * @return `true` if the given URI is a `file` URI 556 * @return `true` if the given URI is a `file` URI
560 */ 557 */
561 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; 558 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
562 } 559 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/source.dart ('k') | pkg/analyzer/test/file_system/resource_uri_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698