Migrate PropertyMapper API for Spring Boot 4.0

Proprietary

Migrates PropertyMapper usage to accommodate Spring Boot 4.0 behavioral changes. In Boot 4.0, PropertyMapper.from() no longer calls to() when the source value is null. This recipe first inserts .always() on bare chains to preserve null-passing behavior, then removes the now-redundant .whenNonNull() and .alwaysApplyingWhenNonNull() calls. Guarded by a Spring Boot < 4.0 precondition so that on subsequent recipe cycles (after the version is bumped by the parent migration recipe), this recipe becomes a no-op — preventing it from incorrectly adding .always() to chains that just had .whenNonNull() stripped.

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

Install it once from Recipe actions, 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. Preserve PropertyMapper null-passing behavior
  2. Remove method invocations org.springframework.boot.context.properties.PropertyMapper alwaysApplyingWhenNonNull()
  3. Remove method invocations org.springframework.boot.context.properties.PropertyMapper.Source whenNonNull()