Replace A.class.isInstance(a) with a instanceof A

MSAL

There should be no A.class.isInstance(a), it should be replaced by a instanceof A. Using instanceof enables the compiler to catch type incompatibilities at compile time rather than silently passing at runtime, which helps detect dead code early.

org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof
mod run . --recipe=org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof

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