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

John Hendrikx jhendrikx at openjdk.org
Mon Nov 25 16:11:22 UTC 2024


On Mon, 25 Nov 2024 12:45:43 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> `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.

I think this is overly cautious.  Overriding equals on a class that did not implement equals in a hierarchy you don't control  is not a very reasonable scenario.  You will not be able to call `super.equals` with reasonable results if the hierarchy did not implement it in the first place.  This is because there may be private data that you can't access for your equality comparison (and `Node` has lots of that).  We also use `WeakHashMap`s in several areas already with subtypes of `Node`s as keys (I found `Region`, `Parent` and `TreeView` being used as keys), so this kind of override should probably be documented as being unsupported on `Node`.

Perhaps it should even be made final so FX internals can rely on it being correct.

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

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


More information about the openjfx-dev mailing list