Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Java 11 recipe -RemovedSecurityManagerMethods #458

Merged

Conversation

ranuradh
Copy link
Contributor

@ranuradh ranuradh commented Apr 18, 2024

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

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@ranuradh ranuradh marked this pull request as draft April 18, 2024 14:50
@ranuradh ranuradh self-assigned this Apr 18, 2024
@ranuradh ranuradh requested a review from cjobinabo April 18, 2024 17:19
@timtebeek timtebeek self-requested a review April 20, 2024 12:43
@ranuradh ranuradh marked this pull request as ready for review April 21, 2024 16:10
@ranuradh
Copy link
Contributor Author

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

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, also for the context around the challenges to test this one. Ran a local test and it all works well.

@timtebeek timtebeek merged commit 2e51b86 into openrewrite:main Apr 22, 2024
2 checks passed
@ranuradh ranuradh deleted the recipe_removedSecurityManagerMethods branch April 22, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants