RFR: 8344896: Remove obsolete checks for AWTPermission accessClipboard

Phil Race prr at openjdk.org
Mon Nov 25 07:01:08 UTC 2024


On Mon, 25 Nov 2024 06:53:43 GMT, Phil Race <prr at openjdk.org> wrote:

> 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.

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 AWTPermissions.
But if https://git.openjdk.org/jdk/pull/22350 is approved earlier than this one, I may add the removal here.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/22356#issuecomment-2497013800


More information about the client-libs-dev mailing list