On Fri, 7 Mar 2025 18:42:36 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> Adding a listener or a binding to the global/static properties outside of 
>> the JavaFX application thread will likely cause concurrent access issues 
>> when the caller, still being executing in the background thread, receives an 
>> event in the context of the JavaFX application thread.
>> 
>> This change enforces accessing Platform::accessibilityActive only from the 
>> JavaFX application thread.
>> 
>> Q: should we also enforce the access rules for Platform::getPreferences() 
>> for the same reason?
>
> Andy Goryachev has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains four additional 
> commits since the last revision:
> 
>  - enforce
>  - Merge remote-tracking branch 'origin/master' into 8351067.accessibility
>  - review comments
>  - javadoc

This **is** the time we systematically approach the subject, see 
https://bugs.openjdk.org/browse/JDK-8348987

The case we are trying to deal with explicitly is initialization of Nodes in 
the background threads which is permitted.  We are not addressing the misuse of 
APIs by the applications, only providing a mechanism to fail early in the 
narrow case when controls/skins/nodes try access the Platform globals.

I believe `::getPReferences()` is the only API in the `Platform` left without 
the explicit check, thus the question.

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

PR Comment: https://git.openjdk.org/jfx/pull/1728#issuecomment-2707468115

Reply via email to