Replace Kotlin property assignment with setter call

Proprietary

Rewrites a Kotlin property-style assignment (obj.prop = value) to an explicit setter invocation (obj.setProp(value)). Use when a Java library adopts JSpecify @NullMarked and a previously-var synthetic property is demoted to val: Kotlin requires the getter's return type and the setter's parameter type to share the same nullability, and once they diverge the assignment stops compiling.

io.moderne.java.spring.kotlin.ReplaceKotlinPropertyAssignmentWithSetterCall

Required

A MethodMatcher pattern identifying the Java setter to convert to. Kotlin property assignments whose resolved setter matches this pattern will be rewritten to an explicit set...(value) call.

The Kotlin synthetic-property name corresponding to the setter (e.g. filter for setFilter, URL for setURL, isEnabled for setEnabled paired with isEnabled()). Kotlin's naming rules preserve acronyms and the is prefix on boolean properties, so the property name is stated explicitly rather than derived.

mod run . --recipe=io.moderne.java.spring.kotlin.ReplaceKotlinPropertyAssignmentWithSetterCall \ -P methodPattern='org.springframework.boot.web.servlet.AbstractFilterRegistrationBean setFilter(..)' \ -P propertyName=filter

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