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

Unified Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2321263003: Remove parseUriWithException() and URISyntaxException. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
index 07e30c8154b3178a2f04ca0768829b02e29a55b5..beba638890fe661c96bc90fb689f2f9b113b3554 100644
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
@@ -16,7 +16,6 @@ import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/java_engine_io.dart';
import 'package:analyzer/src/generated/parser.dart';
@@ -145,8 +144,8 @@ abstract class AbstractDartSdk implements DartSdk {
return null;
}
try {
- return file.createSource(parseUriWithException(path));
- } on URISyntaxException catch (exception, stackTrace) {
+ return file.createSource(Uri.parse(path));
+ } on FormatException catch (exception, stackTrace) {
AnalysisEngine.instance.logger.logInformation(
"Failed to create URI: $path",
new CaughtException(exception, stackTrace));
@@ -208,8 +207,8 @@ abstract class AbstractDartSdk implements DartSdk {
String filePath = srcPath.replaceAll('/', separator);
try {
File file = resourceProvider.getFile(filePath);
- return file.createSource(parseUriWithException(dartUri));
- } on URISyntaxException {
+ return file.createSource(Uri.parse(dartUri));
+ } on FormatException {
return null;
}
}
@@ -332,8 +331,8 @@ class EmbedderSdk extends AbstractDartSdk {
String filePath = srcPath.replaceAll('/', separator);
try {
File file = resourceProvider.getFile(filePath);
- return file.createSource(parseUriWithException(dartUri));
- } on URISyntaxException {
+ return file.createSource(Uri.parse(dartUri));
+ } on FormatException {
return null;
}
}
@@ -646,8 +645,8 @@ class FolderBasedDartSdk extends AbstractDartSdk {
if (!relativePath.isEmpty) {
file = file.parent.getChildAssumingFile(relativePath);
}
- return file.createSource(parseUriWithException(dartUri));
- } on URISyntaxException {
+ return file.createSource(Uri.parse(dartUri));
+ } on FormatException {
return null;
}
}

Powered by Google App Engine
This is Rietveld 408576698