Use Class#getDeclaredConstructor().newInstance()
MSALUse Class#getDeclaredConstructor().newInstance() instead of the deprecated Class#newInstance() in Java 9 or higher.
org. openrewrite. java. migrate. lang. MigrateClassNewInstanceToGetDeclaredConstructorNewInstancemod run . --recipe= org. openrewrite. java. migrate. lang. MigrateClassNewInstanceToGetDeclaredConstructorNewInstanceInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.