RFR: JDK-8344058 : Remove doPrivileged calls from macos platform sources in the java.desktop module
Phil Race
prr at openjdk.org
Fri Nov 15 20:52:44 UTC 2024
On Fri, 15 Nov 2024 18:58:14 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.
>
> src/java.desktop/macosx/classes/com/apple/laf/AquaMenuBarUI.java line 148:
>
>> 146: // Do not allow AWT to set the screen menu bar if it's embedded in another UI toolkit
>> 147: if (LWCToolkit.isEmbedded()) return false;
>> 148: return Boolean.getBoolean(AquaLookAndFeel.sPropertyPrefix + "useScreenMenuBar");
>
> Review required
looks OK
> src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java line 62:
>
>> 60:
>> 61: static {
>> 62: String propValue = System.getProperty("apple.awt.dnd.defaultDragImageSize");
>
> Review required
looks ok
> src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java line 154:
>
>> 152: }
>> 153:
>> 154: loadLibrary();
>
> In-depth review required here.
I think what you are doing is fine.
Unrelated, that System.err.flush() seems odd. I've filed a bug to look at it afterwards since it has NOTHING to do with the doPrivileged.
> src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java line 173:
>
>> 171: System.loadLibrary("awt");
>> 172: System.loadLibrary("fontmanager");
>> 173: }
>
> Refactored System.loadLibrary() calls to a separate static method since they require @SuppressWarnings("restricted") annotation.
I see, because static { .. } doesn't accept an annotation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1844421643
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1844426803
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1844471546
PR Review Comment: https://git.openjdk.org/jdk/pull/22159#discussion_r1844458316
More information about the client-libs-dev
mailing list