Remove Policy.setPolicy(..) calls

MSAL

The Security Manager API is unsupported in Java 24. This recipe removes calls to java.security.Policy#setPolicy(..).

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

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

Recipe list

It runs these recipes, in this order.

  1. Remove method invocations java.security.Policy#setPolicy(..)
  2. Remove catch for a checked exception if the try block does not throw that exception
  3. Unnecessary throws