Remove 'await null' in build mode.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I903a389ab15d45cc18d3678bc44ff8d78ffba683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103083
Reviewed-by: Paul Berry <paulberry@google.com>
diff --git a/pkg/analyzer_cli/lib/src/build_mode.dart b/pkg/analyzer_cli/lib/src/build_mode.dart
index b2e0dfb..5bb4368 100644
--- a/pkg/analyzer_cli/lib/src/build_mode.dart
+++ b/pkg/analyzer_cli/lib/src/build_mode.dart
@@ -79,8 +79,6 @@
*/
Future<void> analyze(
CommandLineOptions options, Map<String, WorkerInput> inputs) async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
var packageBundleProvider =
new WorkerPackageBundleProvider(packageBundleCache, inputs);
var buildMode = new BuildMode(
@@ -99,11 +97,7 @@
*/
@override
Future<WorkResponse> performRequest(WorkRequest request) async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
return logger.runAsync('Perform request', () async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
errorBuffer.clear();
outBuffer.clear();
try {
@@ -148,8 +142,6 @@
*/
@override
Future<void> run() async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
errorSink = errorBuffer;
outSink = outBuffer;
exitHandler = (int exitCode) {
@@ -213,11 +205,7 @@
* Perform package analysis according to the given [options].
*/
Future<ErrorSeverity> analyze() async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
return await logger.runAsync('Analyze', () async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
// Write initial progress message.
if (!options.machineFormat) {
outSink.writeln("Analyzing ${options.sourceFiles.join(', ')}...");
@@ -266,12 +254,8 @@
assembler = new PackageBundleAssembler();
if (_shouldOutputSummary) {
await logger.runAsync('Build and write output summary', () async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
// Prepare all unlinked units.
await logger.runAsync('Prepare unlinked units', () async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
for (var src in explicitSources) {
await _prepareUnlinkedUnit('${src.uri}');
}
@@ -368,8 +352,6 @@
}
Future<ErrorSeverity> _computeMaxSeverity() async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
ErrorSeverity maxSeverity = ErrorSeverity.NONE;
if (!options.buildSuppressExitCode) {
for (Source source in explicitSources) {
@@ -507,8 +489,6 @@
* Otherwise compute it and store into the [uriToUnit] and [assembler].
*/
Future<void> _prepareUnlinkedUnit(String absoluteUri) async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
// Maybe an input package contains the source.
if (summaryDataStore.unlinkedMap[absoluteUri] != null) {
return;
@@ -532,11 +512,7 @@
* is sent to a new file at that path.
*/
Future<void> _printErrors({String outputPath}) async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
await logger.runAsync('Compute and print analysis errors', () async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
StringBuffer buffer = new StringBuffer();
var severityProcessor = (AnalysisError error) =>
determineProcessedSeverity(error, options, analysisOptions);
@@ -650,6 +626,29 @@
}
/**
+ * Wrapper for [InSummaryUriResolver] that tracks accesses to summaries.
+ */
+class TrackingInSummaryUriResolver extends UriResolver {
+ // May be null.
+ final DependencyTracker dependencyTracker;
+ final InSummaryUriResolver inSummaryUriResolver;
+
+ TrackingInSummaryUriResolver(
+ this.inSummaryUriResolver, this.dependencyTracker);
+
+ @override
+ Source resolveAbsolute(Uri uri, [Uri actualUri]) {
+ var source = inSummaryUriResolver.resolveAbsolute(uri, actualUri);
+ if (dependencyTracker != null &&
+ source != null &&
+ source is InSummarySource) {
+ dependencyTracker.record(source.summaryPath);
+ }
+ return source;
+ }
+}
+
+/**
* Worker input.
*
* Bazel does not specify the format of the digest, so we cannot assume that
@@ -744,26 +743,3 @@
return cache.get(inputs, path);
}
}
-
-/**
- * Wrapper for [InSummaryUriResolver] that tracks accesses to summaries.
- */
-class TrackingInSummaryUriResolver extends UriResolver {
- // May be null.
- final DependencyTracker dependencyTracker;
- final InSummaryUriResolver inSummaryUriResolver;
-
- TrackingInSummaryUriResolver(
- this.inSummaryUriResolver, this.dependencyTracker);
-
- @override
- Source resolveAbsolute(Uri uri, [Uri actualUri]) {
- var source = inSummaryUriResolver.resolveAbsolute(uri, actualUri);
- if (dependencyTracker != null &&
- source != null &&
- source is InSummarySource) {
- dependencyTracker.record(source.summaryPath);
- }
- return source;
- }
-}