Replace A.class.isInstance(a) with a instanceof A
MSALThere 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. ReplaceClassIsInstanceWithInstanceofmod run . --recipe= org. openrewrite. staticanalysis. ReplaceClassIsInstanceWithInstanceofInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.