Replace Kotlin method

Proprietary

Replaces Kotlin method calls based on @Deprecated(replaceWith=ReplaceWith(...)) annotations.

org.openrewrite.kotlin.replace.ReplaceKotlinMethod

Required

A method pattern that is used to find matching method invocations.

The replacement expression from @Deprecated(replaceWith=ReplaceWith(...)). Parameter names from the original method can be used directly.

Optional

List of imports to add when the replacement is made. Separate values with commas.

List of classpath resource names for parsing the replacement template. Separate values with commas.

mod run . --recipe=org.openrewrite.kotlin.replace.ReplaceKotlinMethod \ -P methodPattern='arrow.core.MapKt mapOrAccumulate(kotlin.Function2)' \ -P replacement='mapValuesOrAccumulate(transform)'

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