| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.source.io; | 8 library engine.source.io; |
| 9 | 9 |
| 10 import 'source.dart'; | 10 import 'source.dart'; |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 * @param packagesDirectory the "packages" directory (not `null`) | 424 * @param packagesDirectory the "packages" directory (not `null`) |
| 425 * @param pkgName the package name (not `null`, not empty) | 425 * @param pkgName the package name (not `null`, not empty) |
| 426 * @param relPath the path relative to the package directory (not `null`, no l
eading slash, | 426 * @param relPath the path relative to the package directory (not `null`, no l
eading slash, |
| 427 * but may be empty string) | 427 * but may be empty string) |
| 428 * @return the file (not `null`) | 428 * @return the file (not `null`) |
| 429 */ | 429 */ |
| 430 JavaFile getCanonicalFile(JavaFile packagesDirectory, String pkgName, String r
elPath) { | 430 JavaFile getCanonicalFile(JavaFile packagesDirectory, String pkgName, String r
elPath) { |
| 431 JavaFile pkgDir = new JavaFile.relative(packagesDirectory, pkgName); | 431 JavaFile pkgDir = new JavaFile.relative(packagesDirectory, pkgName); |
| 432 try { | 432 try { |
| 433 pkgDir = pkgDir.getCanonicalFile(); | 433 pkgDir = pkgDir.getCanonicalFile(); |
| 434 } on JavaIOException catch (e) { | 434 } on JavaIOException catch (exception, stackTrace) { |
| 435 if (!e.toString().contains("Required key not available")) { | 435 if (!exception.toString().contains("Required key not available")) { |
| 436 AnalysisEngine.instance.logger.logError2("Canonical failed: $pkgDir", e)
; | 436 AnalysisEngine.instance.logger.logError( |
| 437 "Canonical failed: $pkgDir", |
| 438 new CaughtException(exception, stackTrace)); |
| 437 } else if (_CanLogRequiredKeyIoException) { | 439 } else if (_CanLogRequiredKeyIoException) { |
| 438 _CanLogRequiredKeyIoException = false; | 440 _CanLogRequiredKeyIoException = false; |
| 439 AnalysisEngine.instance.logger.logError2("Canonical failed: $pkgDir", e)
; | 441 AnalysisEngine.instance.logger.logError( |
| 442 "Canonical failed: $pkgDir", |
| 443 new CaughtException(exception, stackTrace)); |
| 440 } | 444 } |
| 441 } | 445 } |
| 442 return new JavaFile.relative(pkgDir, relPath.replaceAll('/', new String.from
CharCode(JavaFile.separatorChar))); | 446 return new JavaFile.relative(pkgDir, relPath.replaceAll('/', new String.from
CharCode(JavaFile.separatorChar))); |
| 443 } | 447 } |
| 444 | 448 |
| 445 /** | 449 /** |
| 446 * @return `true` if "file" was found in "packagesDir", and it is part of the
"lib" folder | 450 * @return `true` if "file" was found in "packagesDir", and it is part of the
"lib" folder |
| 447 * of the application that contains in this "packagesDir". | 451 * of the application that contains in this "packagesDir". |
| 448 */ | 452 */ |
| 449 bool _isSelfReference(JavaFile packagesDir, JavaFile file) { | 453 bool _isSelfReference(JavaFile packagesDir, JavaFile file) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 for (JavaFile dir in _relativeDirectories) { | 503 for (JavaFile dir in _relativeDirectories) { |
| 500 JavaFile file = new JavaFile.relative(dir, filePath); | 504 JavaFile file = new JavaFile.relative(dir, filePath); |
| 501 if (file.exists()) { | 505 if (file.exists()) { |
| 502 return new FileBasedSource.con2(uri, file); | 506 return new FileBasedSource.con2(uri, file); |
| 503 } | 507 } |
| 504 } | 508 } |
| 505 } | 509 } |
| 506 return null; | 510 return null; |
| 507 } | 511 } |
| 508 } | 512 } |
| OLD | NEW |