Use JsonFactory.builder() over new JsonFactoryBuilder()
Apache 2.0After the Jackson 2 → 3 migration, prefer the concrete static JsonFactory.builder() entry over new JsonFactoryBuilder() so JsonFactory chains read the same way as the format-aligned factories (YAMLFactory.builder(), CBORFactory.builder(), etc.). The reason MigrateFactorySettersToBuilder emits new JsonFactoryBuilder() in the first place is a Jackson 2 quirk — JsonFactory.builder() returned the wildcard TSFBuilder<?, ?> there. In Jackson 3 the static returns a concretely-typed JsonFactoryBuilder, so the constructor form no longer earns its keep.
org. openrewrite. java. jackson. UseJsonFactoryStaticBuildermod run . --recipe= org. openrewrite. java. jackson. UseJsonFactoryStaticBuilderInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.