Changes an argument (or pair of arguments) to a TimeValue for matched method invocations

MSAL

In Apache Http Client 5.x migration, some methods that previously took a single long argument, or a pair of arguments of type long and TimeUnit respectively, have changed to take a TimeValue. Previously in 4.x, all these single long argument methods were implicitly having the value expressed in milliseconds. By default this recipe uses TimeUnit.MILLISECONDS for the TimeUnit when creating a TimeValue. It is possible to specify this as a option. The timeUnit option will be ignored for cases matching `*(long, TimeUnit).

org.openrewrite.apache.httpclient5.ChangeArgumentToTimeValue

Required

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

Optional

The TimeUnit enum value we want to use to turn the original value into a TimeValue. Defaults to MILLISECONDS.

mod run . --recipe=org.openrewrite.apache.httpclient5.ChangeArgumentToTimeValue \ -P methodPattern='org.apache.http.impl.nio.reactor.IOReactorConfig.Builder setSelectInterval(long)'

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