Fold Jackson2JsonRedisSerializer#setObjectMapper into the constructor

Proprietary

JacksonJsonRedisSerializer, the Jackson 3 replacement of Jackson2JsonRedisSerializer, has no setObjectMapper(..); the ObjectMapper is a constructor argument. This recipe folds serializer.setObjectMapper(mapper) into the constructor (new Jackson2JsonRedisSerializer<>(mapper, type)) and removes the setter when the serializer is created in the same block. Declarations that the argument needs are moved in front of the serializer when nothing else lies in between. Setters that cannot be folded are left unchanged.

io.moderne.java.spring.boot4.MigrateJackson2JsonRedisSerializerConstructor
mod run . --recipe=io.moderne.java.spring.boot4.MigrateJackson2JsonRedisSerializerConstructor

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