RFR: 8291853: [CSS] ClassCastException in CssStyleHelper calculateValue [v2]

Marius Hanl mhanl at openjdk.org
Thu Nov 10 20:42:41 UTC 2022


On Thu, 10 Nov 2022 20:11:55 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> A race condition exists where a derived color depends on another derived color which has not been yet defined or processed.  The only side effect of this condition is a ClassCastException - the color eventually gets resolved.
>> 
>> Solution: initialize the derived color to transparent earlier to suppress the exception.
>> 
>> This was also a test bug https://bugs.openjdk.org/browse/JDK-8198604
>
> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8291853: review comments

So this really is not a bug in the CSS parser after all?

modules/javafx.controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena.css line 360:

> 358:     -fx-cell-focus-inner-border: derive(-fx-selection-bar,30%);
> 359: 
> 360:     /* Cell border color is initialized here to avoid a race condition during initialization */

I would still instead write something like `/**Border color for table cells. */` and _maybe_ link the JDK ticket. But developers looking in modena.css are more interested what the variables do than why they are there. But open for other opinions

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

PR: https://git.openjdk.org/jfx/pull/947


More information about the openjfx-dev mailing list