OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_impl; | 5 library analyzer_impl; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 134 matching lines...) Loading... |
145 } | 145 } |
146 | 146 |
147 Source computeLibrarySource() { | 147 Source computeLibrarySource() { |
148 JavaFile sourceFile = new JavaFile(sourcePath); | 148 JavaFile sourceFile = new JavaFile(sourcePath); |
149 Source source = sdk.fromFileUri(sourceFile.toURI()); | 149 Source source = sdk.fromFileUri(sourceFile.toURI()); |
150 if (source != null) { | 150 if (source != null) { |
151 return source; | 151 return source; |
152 } | 152 } |
153 source = new FileBasedSource.con2(sourceFile.toURI(), sourceFile); | 153 source = new FileBasedSource.con2(sourceFile.toURI(), sourceFile); |
154 Uri uri = context.sourceFactory.restoreUri(source); | 154 Uri uri = context.sourceFactory.restoreUri(source); |
| 155 if (uri == null) { |
| 156 return source; |
| 157 } |
155 return new FileBasedSource.con2(uri, sourceFile); | 158 return new FileBasedSource.con2(uri, sourceFile); |
156 } | 159 } |
157 | 160 |
158 /** | 161 /** |
159 * Create and return the source factory to be used by the analysis context. | 162 * Create and return the source factory to be used by the analysis context. |
160 */ | 163 */ |
161 SourceFactory createSourceFactory() { | 164 SourceFactory createSourceFactory() { |
162 List<UriResolver> resolvers = [ | 165 List<UriResolver> resolvers = [ |
163 new CustomUriResolver(options.customUrlMappings), | 166 new CustomUriResolver(options.customUrlMappings), |
164 new DartUriResolver(sdk) | 167 new DartUriResolver(sdk) |
(...skipping 289 matching lines...) Loading... |
454 } | 457 } |
455 } | 458 } |
456 | 459 |
457 @override | 460 @override |
458 void logInformation2(String message, Object exception) { | 461 void logInformation2(String message, Object exception) { |
459 if (log) { | 462 if (log) { |
460 stdout.writeln(message); | 463 stdout.writeln(message); |
461 } | 464 } |
462 } | 465 } |
463 } | 466 } |
OLD | NEW |