RFR: 8344064: Remove doPrivileged calls from print/imageio/media classes in the java.desktop module [v2]

Phil Race prr at openjdk.org
Tue Nov 19 18:28:55 UTC 2024


On Tue, 19 Nov 2024 17:42:19 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8344064
>
> src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java line 512:
> 
>> 510:         private static int GET_IMAGE      = 2;
>> 511: 
>> 512:         public Object getThemeItem(int type, Object arg) {
> 
> I think it's worth to split this huge method into 3. getThemeDir, getUserTheme, getImage.
> Looks like the only reason why it was put into single method - is to have single `PrivilegedAction` class

No. Refactoring is explicitly a non-goal in these PRs. And minimising required refactoring is a goal.

> src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java line 801:
> 
>> 799:                             }
>> 800:                             return null;
>> 801:                         }).run();
> 
> Let's unwrap this `RunnableAction` and put code directly in the `getDefaultSoundbank`

No. Refactoring is explicitly a non-goal in these PRs. And minimising required refactoring is a goal.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22186#discussion_r1848850121
PR Review Comment: https://git.openjdk.org/jdk/pull/22186#discussion_r1848850206


More information about the client-libs-dev mailing list