Transform classes that extend a given class to implement the given interface instead

MSAL

As of Spring Batch 5.x listeners have default methods (made possible by a Java 8 baseline) and can be implemented directly without the need for this adapter.

org.openrewrite.java.spring.batch.ReplaceSupportClassWithItsInterface

Required

A fully-qualified class name to be replaced.

A fully-qualified Interface name to replace by.

mod run . --recipe=org.openrewrite.java.spring.batch.ReplaceSupportClassWithItsInterface \ -P fullyQualifiedClassName=org.springframework.batch.core.listener.JobExecutionListenerSupport \ -P fullyQualifiedInterfaceName=org.springframework.batch.core.JobExecutionListener

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