ebd8c46b85
We do this by passing a CorrectionProducerContext up each of the constructors. We can then remove all `configure` methods. This requires a few changes and allows a few changes: * Remove ParsedCorrectionProducer. It does not seem to have served a purpose. * CorrectionProducerContext no longer needs to be generic. * Add a public getter for `MultiCorrectionProducer._context`, so that a multi correction producer can pass along its context to child correction producers. * Introduce a `CorrectionProducerContext.instance` dummy variable, used when we need to check if a correction producer can be applied in bulk. * Make `CorrectionProducerContext._node` public, so that it can be used in factory constructors. * `BulkFixProcesor.correctionContext()` return type is non-nullable. * Add a factory constructor for AddMissingParameter, and move the `configure` logic there. * Add a factory constructor for ConvertAddAllToSpread, and move the `configure` logic there. Then make `_isInlineInvocation` and `_invocation` final. * Add a factory constructor for ReplaceFinalWithVar, and move the `configure` logic there. Then make `_removeFinal` and `_finalKeyword` final. * Add a factory constructor for ReplaceWithIsEmpty, and move the `configure` logic there. Then make `fixKind`, `multiFixKind`, `_binary`, and `_replacement` final. * Rename `_AddMissingParameter.context` to `_executableParameters`, and make it final. Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try Change-Id: If0e9bc1cbf5c8e656938bc6cd4eb32a9d4f06b38 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368760 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>