On Sat, 10 Oct 2026 14:16:13 GMT, Kevin Rushforth <[email protected]> wrote:

>> Makes sense! Also not a fan of a static initializer. 
>> 
>> I think what Andy meant though (thats at least how I understood it), is that 
>> maybe some of those variables can be initialized directly by a one-liner, as 
>> the code got a bit shorter. But this is also not possible in a good way.
>
>> This pattern was [deliberately 
>> introduced](https://github.com/openjdk/jfx/pull/1608#discussion_r1819938688) 
>> so that static constants can be initialized from an expression.
> 
> Right, I remember now. This keeps the changes localized without introducing a 
> bunch of static helper methods.

Yes, it was done as as to minimize the diff as a part of a larger PR.  It is 
probably ok since it's a slightly heavier variant of a static initializer (one 
extra allocation, I think).  I just don't want someone looking at this code and 
saying, "oh cool idea, let's do it everywhere".

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2299#discussion_r4249162771

Reply via email to