On Mon, 25 Nov 2024 12:35:49 GMT, Michael Strauß <mstra...@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

Reply via email to