RFR: 8342703: CSS transition is not started when initial value was not specified

Marius Hanl mhanl at openjdk.org
Mon Nov 25 12:48:24 UTC 2024


On Mon, 25 Nov 2024 12:35:49 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/Scene.java line 607:
>> 
>>> 605:      * CSS state (see {@link Node#initialCssState}.
>>> 606:      */
>>> 607:     private final Set<Node> clearInitialCssStateNodes = Collections.newSetFromMap(new IdentityHashMap<>());
>> 
>> why not use a normal `HashSet`? What advantage has this approach?
>
> `HashSet` uses `Object.equals`, which can be overridden by user code, and this would break the logic. It's the _instance_ that wants to be notified.

Good point, I never ever did that for `Node`s (and I don't know why I would need to), but you are right, it is indeed possible and therefore a possible scenario.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1607#discussion_r1856557026


More information about the openjfx-dev mailing list