On Mon, 24 Nov 2025 16:16:32 GMT, Andy Goryachev <[email protected]> wrote:

>> I would recommend to use the Accessor pattern then.
>> 
>> Reflection is brittle, the IDEs won't track the dependency, and I prefer 
>> clear and obvious dependencies.  Besides, this is the pattern used 
>> throughout the JavaFX code.
>
> ... I realized it's only for testing.  It's probably ok, for testing.  Maybe 
> add a comment to the field saying that the reflection is used to access this 
> field by tests?

I think I'll leave it as is, because it's covered by tests. It won't go 
unnoticed when someone tries to change the name of the field, and adjusting the 
unit tests is trivial.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1977#discussion_r2559576788

Reply via email to