On Tue, 7 Jul 2026 22:11:13 GMT, Kevin Rushforth <[email protected]> wrote:

>> Andy Goryachev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   proper initialization
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java 
> line 1439:
> 
>> 1437:    }
>> 1438: 
>> 1439:    private volatile ColorGlyphStrike[] sbixStrikes;
> 
> I don't have time to look at this for jfx27, so I recommend leaving it for 
> after the fork, but I see at one other related threading issue. Both should 
> be fixed at the same time (else there is little point in changing anything). 
> The `buildSbixStrikeTables()` could be called twice, since it isn't inside 
> the inner `if (sbixStrikes == null)`. It won't be called concurrently, but 
> will still do the initialization more than once which is, at best, 
> unnecessary.
> 
> Minor: I prefer to leave the `= null` that you removed, since code is 
> checking / relying on the initial value (yes I know it doesn't actually 
> matter, but I find it more self-documenting with the explicit initialization).

Good point, the whole thing is funky.  I've restructured the code to make sure 
it is a proper double check locking and the `buildSbixStrikeTables()` is called 
only once.

For the null field, it's not necessary per JLS 4.12.5
https://docs.oracle.com/javase/specs/jls/se26/html/jls-4.html#jls-4.12.5 :

> For all reference types 
> ([ยง4.3](https://docs.oracle.com/javase/specs/jls/se26/html/jls-4.html#jls-4.3)),
>  the default value is null.

Besides, it annoys me when the debugger steps at each pointless assignments 
each time.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2205#discussion_r3545047748

Reply via email to