RFR: JDK-8294427 - Check boxes and radio buttons have rendering issues on Windows in High DPI env [v6]

Alexey Ivanov aivanov at openjdk.org
Tue May 30 16:08:02 UTC 2023


On Tue, 30 May 2023 15:43:57 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Rajat Mahajan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   changes as siggested in review
>
> src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java line 131:
> 
>> 129:                         }
>> 130:                         dpiAwareWidgetToTheme.get(dpi).clear();
>> 131:                         dpiAwareWidgetToTheme.clear();
> 
> Suggestion:
> 
>                         for (Map<String, Long> dpiVal : dpiAwareWidgetToTheme.values()) {
>                             for (Long value : dpiVal.values()) {
>                                 closeTheme(value);
>                             }
>                             dpiVal.clear();
>                         }
>                         dpiAwareWidgetToTheme.clear();
> 
> Avoid additional call to `get`.

This is even more serious: all the theme handles are closed but the maps for DPIs other than the passed `dpi` aren't cleared. With `clear` inside the loop, maps for all DPIs are cleared.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13701#discussion_r1210504722



More information about the client-libs-dev mailing list