RFR: 8301302: Platform preferences API [v20]

Michael Strauß mstrauss at openjdk.org
Thu Nov 2 19:15:13 UTC 2023


On Thu, 2 Nov 2023 19:05:27 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   changend bool comparison
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/application/preferences/PlatformPreferences.java line 198:
> 
>> 196:      * @throws NullPointerException if {@code preferences} is {@code null}
>> 197:      */
>> 198:     public void update(Map<String, Object> preferences) {
> 
> I want to make sure I understand the exact details of the update rules. Is this correct?
> 
> For each key in `preferences`:
> * if it exists in `effectivePreferences`:
>     * if the values are the same, there is no change (`preferences` contains all mapping and not just the changes)
>     * if the value in `preferences` is `null`, then this is a removal operation (because the value of `effectivePreferences` can't be `null`)
>     * if the value in `preferences` is not `null` and not the same, then this is an update operation
> * if it doesn't exist in `effectivePreferences`:
>     * if the value in `preferences` is not `null`, then this is an add operation
>     * can the value in `preferences` be `null`?

That's correct.

> can the value in preferences be `null`?

It could be `null` (signalling a removal), but then that's a no-op if the key wasn't present in `effectivePreferences`.

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

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


More information about the openjfx-dev mailing list