Use static random fill for proven closed providers

Proprietary

Compose the five conservative fresh-array RNGCryptoServiceProvider Fill ports: adjacent using statement, body-local array, using declaration, direct inline receiver and plain local. Preserve each handler's allocation, closure, comments, typing and failure bounds. Leave nonzero/ranged/shared/unproven/configured/factory origins and conditional snapshots unchanged. Opt-in modern API port; no algorithm, size, seed, ownership or persistence policy choice.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseClosedRandomFills
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseClosedRandomFills

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Use static random fill for a fresh array and closed provider
  2. Use static random fill for a fresh array inside a closed provider block
  3. Use static random fill for a fresh array and closed using declaration
  4. Use static random fill for an inline provider and fresh array
  5. Use static random fill for a fresh array and closed plain local