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

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

Issue 1933763002: Use null-aware operators to clean up the code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Additional clean-up Created 4 years, 7 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 analyzer.src.generated.source; 5 library analyzer.src.generated.source;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 @override 106 @override
107 Source resolveAbsolute(Uri uri, [Uri actualUri]) { 107 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
108 String mapping = _urlMappings[uri.toString()]; 108 String mapping = _urlMappings[uri.toString()];
109 if (mapping == null) return null; 109 if (mapping == null) return null;
110 110
111 Uri fileUri = new Uri.file(mapping); 111 Uri fileUri = new Uri.file(mapping);
112 if (!fileUri.isAbsolute) return null; 112 if (!fileUri.isAbsolute) return null;
113 113
114 JavaFile javaFile = new JavaFile.fromUri(fileUri); 114 JavaFile javaFile = new JavaFile.fromUri(fileUri);
115 return new FileBasedSource(javaFile, actualUri != null ? actualUri : uri); 115 return new FileBasedSource(javaFile, actualUri ?? uri);
116 } 116 }
117 } 117 }
118 118
119 /** 119 /**
120 * Instances of the class `DartUriResolver` resolve `dart` URI's. 120 * Instances of the class `DartUriResolver` resolve `dart` URI's.
121 */ 121 */
122 class DartUriResolver extends UriResolver { 122 class DartUriResolver extends UriResolver {
123 /** 123 /**
124 * The name of the `dart` scheme. 124 * The name of the `dart` scheme.
125 */ 125 */
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 Source resolveAbsolute(Uri uri, [Uri actualUri]); 930 Source resolveAbsolute(Uri uri, [Uri actualUri]);
931 931
932 /** 932 /**
933 * Return an absolute URI that represents the given [source], or `null` if a 933 * Return an absolute URI that represents the given [source], or `null` if a
934 * valid URI cannot be computed. 934 * valid URI cannot be computed.
935 * 935 *
936 * The computation should be based solely on [source.fullName]. 936 * The computation should be based solely on [source.fullName].
937 */ 937 */
938 Uri restoreAbsolute(Source source) => null; 938 Uri restoreAbsolute(Source source) => null;
939 } 939 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698