On Fri, 24 Nov 2023 21:57:04 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

>> I don't understand. This is an overridden method, do you propose to 
>> introduce another `private static final` method, and 
>> `getPlatformKeyMappings` then calls out to this other method?
>
> I meant that it is a constant, which I think would be good to extract.  I 
> think you may have mentioned it isn't called a whole lot, but recreating an 
> immutable sometimes (large) map just seems unnecessary.
> 
>     private static final Map<String, String> MAPPINGS = Map.of(
>         "GTK.theme_fg_color", "foregroundColor",
>         "GTK.theme_bg_color", "backgroundColor"
>     );
> 
>     @Override
>     public Map<String, String> getPlatformKeyMappings() {
>         return MAPPINGS;
>     }

It's only called once to initialize `PlatformPreferences`, so we should be fine.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1014#discussion_r1404702040

Reply via email to