openrewrite / rewrite-migrate-java

OpenRewrite recipes for migrating to newer versions of Java.
Apache License 2.0
92 stars 65 forks source link

Adding Java 11 recipe -RemovedSecurityManagerMethods #458

Closed ranuradh closed 2 months ago

ranuradh commented 2 months ago

What's changed?

Added recipe for the following: image

This recipe replaces methods returning void that are deprecated in the SecurityManager class in Java SE 11. The methods checkAwtEventQueueAccess(),checkSystemClipboardAccess(),checkMemberAccess() and checkTopLevelWindow() are replaced by checkPermission(new java.security.AllPermission()).

Since it was not possible to test the recipe. I created sample files, created a local plugin using ./gradlew publishToMavenLocal then ran it in the Java8 Sample App using mvn rewrite:dryRun

Attaching the rewrite.patch file rewrite.patch

Anyone you would like to review specifically?

Checklist

ranuradh commented 2 months ago

@timtebeek and @cjobinabo could we complete the review and merge this. Since I believe we need this for our next release.