-
Notifications
You must be signed in to change notification settings - Fork 90
Security Manager API Removal #713
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 1002-1009
- lines 1033-1042
Other GitHub Examples: full SecurityManager security = System.getSecurityManager();
if (security != null) {
try {
security.checkSystemClipboardAccess();
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
} catch (SecurityException e) {
clipboard = new Clipboard("Application Clipboard");
}
} Should become clipboard = new Clipboard("Application Clipboard"); or clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); and (original) SecurityManager sm = System.getSecurityManager();
if (sm != null) sm.checkPermission(new PropertyPermission("user.language", "write")); Should be removed completely. (bearbeitet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address the comment I posted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 20-19
- lines 59-69
- lines 105-106
- lines 216-215
- lines 239-240
- lines 490-499
- lines 538-537
- lines 559-575
- lines 997-1004
- lines 1033-1042
- lines 1092-1110
- lines 3147-3169
- lines 3198-3197
- lines 5616-5625
- lines 5643-5642
- lines 5796-5795
- lines 5831-5832
- lines 6581-6593
- lines 6606-6617
- lines 6631-6630
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 20-19
- lines 59-69
- lines 105-106
- lines 216-215
- lines 239-240
- lines 490-499
- lines 538-537
- lines 559-575
- lines 997-1004
- lines 1033-1042
- lines 1092-1110
- lines 3147-3169
- lines 3198-3197
- lines 5616-5625
- lines 5643-5642
- lines 5796-5795
- lines 5831-5832
- lines 6581-6593
- lines 6606-6617
- lines 6631-6630
I'm seeing here
So then can we do the simplest thing here and make that explicit? So going from SecurityManager security = System.getSecurityManager();
if (security != null) { ... } To SecurityManager security = null;
if (security != null) { ... } That recipe should be very simple to write, and makes explicit what's now implicit. We do a very similar thing in rewrite-feature-flags where we replace the method invocation with a literal, and then call out to other visitors to clean up. Removing that conditional should then happen by default when the variable is always |
Yes, a decent option here. I will submit a second PR dealing with Securtity Manager. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 20-19
- lines 59-69
- lines 105-106
- lines 216-215
- lines 239-240
- lines 490-499
- lines 538-537
- lines 559-575
- lines 997-1004
- lines 1033-1042
- lines 1092-1110
- lines 3147-3169
- lines 3198-3197
- lines 5616-5625
- lines 5643-5642
- lines 5796-5795
- lines 5831-5832
- lines 6581-6593
- lines 6606-6617
- lines 6631-6630
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/resources/META-INF/rewrite/examples.yml
- lines 20-19
- lines 59-69
- lines 105-106
- lines 216-215
- lines 239-240
- lines 490-499
- lines 538-537
- lines 559-575
- lines 997-1004
- lines 1033-1042
- lines 1092-1110
- lines 3147-3169
- lines 3198-3197
- lines 5616-5625
- lines 5643-5642
- lines 5796-5795
- lines 5831-5832
- lines 6581-6593
- lines 6606-6617
- lines 6631-6630
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
What's changed?
With Java 24 the Security Manager API pushes users from using itself. We can help by removing the methods.
What's your motivation?
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist