Remove permission checks on the system SecurityManager
MSALRemove SecurityManager#check*(..) calls whose receiver is System.getSecurityManager(), directly or through a local variable that only ever holds its result. Since Java 24 there is no system SecurityManager, so these checks are dead code. Checks on any other SecurityManager, such as a parameter, a field or a custom subclass, are kept: such an instance still enforces its own policy, and removing the check would silently allow every action. Blocks left empty and SecurityManager locals left unused are removed afterwards.
org. openrewrite. java. migrate. RemoveSystemSecurityManagerChecksmod run . --recipe= org. openrewrite. java. migrate. RemoveSystemSecurityManagerChecksInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.