-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8344896: Remove obsolete checks for AWTPermission accessClipboard #22356
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
|
👋 Welcome back prr! A progress list of the required criteria for merging this PR into |
|
@prrace This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 18 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
I did not remove ACCESS_CLIPBOARD_PERMISSION from sun.awt.AWTPermissions since I am concurrently updating that class in a different PR (https://git.openjdk.org/jdk/pull/22350) , and I know that I will be able to revisit the class when deprecating java.awt.AWTPermission. |
Webrevs
|
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.
few tests use this permission indirectly:
./test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java:94: sm.checkPermission(new AWTPermission("accessClipboard"));
./test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java:87: sm.checkPermission(new AWTPermission("accessClipboard"));
./test/jdk/java/awt/datatransfer/SystemSelection/SystemSelectionSwingTest.java:87: sm.checkPermission(new AWTPermission("accessClipboard"));
./test/jdk/java/awt/datatransfer/SystemSelection/SystemSelectionAWTTest.java:86: sm.checkPermission(new AWTPermission("accessClipboard"));
| @SuppressWarnings("removal") | ||
| SecurityManager security = System.getSecurityManager(); | ||
| if (security != null) { | ||
| security.checkPermission(AWTPermissions.ACCESS_CLIPBOARD_PERMISSION); |
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.
import java.util.Hashtable;
import sun.awt.AWTPermissions;
can be removed
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.
ok
I had listed these bugs in https://bugs.openjdk.org/browse/JDK-8344654 for @honkar-jdk to update. |
azvegint
left a comment
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.
I had listed these bugs in https://bugs.openjdk.org/browse/JDK-8344654 for @honkar-jdk to update.
I will check with her if she will get to these soon, otherwise I can address them here.
Good to know, I guess we can leave them for the JDK-8344654 then.
I have these tests updated as part of the JBS mentioned above (not created a PR yet). |
|
/integrate |
|
Going to push as commit 4d898aa.
Your commit was automatically rebased without conflicts. |
This removes the SecurityManager related checks for clipboard access and methods which exist solely to support that.
One interesting thing is that there are two places where a method "canAccessSystemClipboard()" was not only about the SM.
In SwingUtilities and InputEvent it would return false in headless mode, regardless of whether there is an SM.
This means I have left the methods in place, behaving the same as before in headless mode.
We may be able to further simplify this later but it will be clearer with the SM-only logic removed and out of scope for this fix.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22356/head:pull/22356$ git checkout pull/22356Update a local copy of the PR:
$ git checkout pull/22356$ git pull https://git.openjdk.org/jdk.git pull/22356/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22356View PR using the GUI difftool:
$ git pr show -t 22356Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22356.diff
Using Webrev
Link to Webrev Comment