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

>> I'm not a big fan of that because of its impact on the source code of the 
>> class (you know those comments: "package-private only for the sake of 
>> testing").
>
> 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?

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

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

Reply via email to