Replace AWT getPeer() method

MSAL

This recipe replaces the use of getPeer() method in java.awt.* classes. component.getPeer() != null is replaced with component.isDisplayable() and component.getPeer() instanceof LightweightPeer is replaced with component.isLightweight().

org.openrewrite.java.migrate.ReplaceAWTGetPeerMethod

Optional

A method pattern matching the getPeer() method to replace.

The fully qualified name of the LightweightPeer interface to replace in instanceof.

mod run . --recipe=org.openrewrite.java.migrate.ReplaceAWTGetPeerMethod

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