OLD | NEW |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } on JavaIOException catch (exception, stackTrace) { | 408 } on JavaIOException catch (exception, stackTrace) { |
409 if (!exception.toString().contains("Required key not available")) { | 409 if (!exception.toString().contains("Required key not available")) { |
410 AnalysisEngine.instance.logger.logError("Canonical failed: $pkgDir", | 410 AnalysisEngine.instance.logger.logError("Canonical failed: $pkgDir", |
411 new CaughtException(exception, stackTrace)); | 411 new CaughtException(exception, stackTrace)); |
412 } else if (_CanLogRequiredKeyIoException) { | 412 } else if (_CanLogRequiredKeyIoException) { |
413 _CanLogRequiredKeyIoException = false; | 413 _CanLogRequiredKeyIoException = false; |
414 AnalysisEngine.instance.logger.logError("Canonical failed: $pkgDir", | 414 AnalysisEngine.instance.logger.logError("Canonical failed: $pkgDir", |
415 new CaughtException(exception, stackTrace)); | 415 new CaughtException(exception, stackTrace)); |
416 } | 416 } |
417 } | 417 } |
418 return new JavaFile.relative(pkgDir, relPath.replaceAll( | 418 return new JavaFile.relative( |
419 '/', new String.fromCharCode(JavaFile.separatorChar))); | 419 pkgDir, |
| 420 relPath.replaceAll( |
| 421 '/', new String.fromCharCode(JavaFile.separatorChar))); |
420 } | 422 } |
421 | 423 |
422 @override | 424 @override |
423 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 425 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
424 if (!isPackageUri(uri)) { | 426 if (!isPackageUri(uri)) { |
425 return null; | 427 return null; |
426 } | 428 } |
427 String path = uri.path; | 429 String path = uri.path; |
428 if (path == null) { | 430 if (path == null) { |
429 path = uri.path; | 431 path = uri.path; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 552 } |
551 | 553 |
552 /** | 554 /** |
553 * Return `true` if the given URI is a `file` URI. | 555 * Return `true` if the given URI is a `file` URI. |
554 * | 556 * |
555 * @param uri the URI being tested | 557 * @param uri the URI being tested |
556 * @return `true` if the given URI is a `file` URI | 558 * @return `true` if the given URI is a `file` URI |
557 */ | 559 */ |
558 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; | 560 static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME; |
559 } | 561 } |
OLD | NEW |