RFR: 8301302: Platform preferences API [v18]

Michael Strauß mstrauss at openjdk.org
Wed Nov 1 02:19:36 UTC 2023


On Tue, 31 Oct 2023 20:19:42 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - formatting
>>  - Javadoc change
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java line 1094:
> 
>> 1092:     // This method will be removed when StyleThemes are added.
>> 1093:     private static void checkHighContrastThemeChanged(Map<String, Object> preferences) {
>> 1094:         if (preferences.get("Windows.SPI.HighContrastOn") == Boolean.TRUE) {
> 
> It's better to not use reference equality here, as `new Boolean("true") != Boolean.TRUE`.
> Suggestion:
> 
>         if (Boolean.TRUE.equals(preferences.get("Windows.SPI.HighContrastOn")) {

This might not be an issue, considering that the Boolean(String) constructor is terminally deprecated anyway.

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

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


More information about the openjfx-dev mailing list