RFR: JDK-8344058 : Remove doPrivileged calls from macos platform sources in the java.desktop module

Alexey Ivanov aivanov at openjdk.org
Mon Nov 18 19:22:02 UTC 2024


On Fri, 15 Nov 2024 18:45:11 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> Post JEP-486 (Permanently Disable the Security Manager) cleanup. 
> Calls to java.security.AccessController.doPrivileged are obsolete thus removed in this PR.
> 
> This PR addresses removal of AccessController.doPrivileged() calls from macos-platform files in the java.desktop module.Any SM related imports that are no longer needed are removed.
> 
> This PR is limited to removing doPrivileged() calls and excludes any refactoring, reformatting, or other clean up that is out-of-scope for this fix.
> 
> PS: I have explicitly add comments to the changes where a more watchful review is required.

Looks good except for a couple of nits.

src/java.desktop/macosx/classes/sun/awt/PlatformGraphicsInfo.java line 35:

> 33: 
> 34:     static {
> 35:             System.loadLibrary("awt");

Decrease indentation?

src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 82:

> 80:     @SuppressWarnings("restricted")
> 81:     private static void loadAWTLibrary() {
> 82:             // Need to load the native library for this code.

Decrease indentation?

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java line 344:

> 342:                     onEventThread = true;
> 343: 
> 344:                     printingLoop =  Toolkit.getDefaultToolkit().getSystemEventQueue().createSecondaryLoop();

I'd prefer if you preserved line wrapping, I find it easier to read chained calls in this way.

There's also an extra space after `=`.

src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java line 185:

> 183:     public LWCToolkit() {
> 184:         final String extraButtons = "sun.awt.enableExtraMouseButtons";
> 185:             areExtraMouseButtonsEnabled =

Decrease indentation?

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

Marked as reviewed by aivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22159#pullrequestreview-2443435604
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1847089679
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1847095552
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1847098542
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1847124825


More information about the client-libs-dev mailing list