RFR: 8301302: Platform preferences API [v40]

Kevin Rushforth kcr at openjdk.org
Wed Dec 6 18:41:29 UTC 2023


On Wed, 6 Dec 2023 00:52:32 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Please read [this document](https://gist.github.com/mstr2/9f46f92c98d3c86aa6a0b4224a9a6548) for an introduction to the Platform Preferences API, and how it interacts with the proposed style theme and stage appearance features.
>
> Michael Strauß has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - null checking
>  - rename GLASS_CHECK_EXCEPTIONALLY_RETURN

I retested (sanity test) and all looks good.

I left one comment about a change that I think is needed to one of the error checks you added. The rest looks good.

modules/javafx.graphics/src/main/native-glass/win/RoActivationSupport.cpp line 208:

> 206:     int message_length = int(strlen(message));
> 207:     int error_length = WideCharToMultiByte(CP_ACP, 0, error, -1, NULL, 0, NULL, FALSE);
> 208:     if (message_length + error_length == 0) return;

Unless I'm missing something, this test should just be `if (error_length == 0)` -- note that a 0 value indicates an error (since the count includes the null terminator). The concern is that if `WideCharToMultiByte` returns a 0, then you will construct a string with no null terminator, since the subsequent call to `WideCharToMultiByte` would do nothing and you (intentionally) don't copy the null terminator from the message.

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

PR Review: https://git.openjdk.org/jfx/pull/1014#pullrequestreview-1768319891
PR Review Comment: https://git.openjdk.org/jfx/pull/1014#discussion_r1417794955


More information about the openjfx-dev mailing list