On Thu, 1 Oct 2026 15:15:00 GMT, Nir Lisker <[email protected]> wrote:

> Are we specifying that invalidation listeners and change listeners use the 
> same equality mechanism?

No, I think the distinction is clear:
- Invalidation is about reference identity `==` (with `String` being the only 
exception, use `ObjectProperty<String>` if you want to avoid that)
- Change is about equality

So that means if you care about identity, you really shouldn't be using a 
change listener.

> Are we ready for the upcoming value objects?

Yes, I think so. When it comes to change listeners, we've always assumed that 
the type involved is effectively immutable with a stable `equals()` (ie. 
something that could be made into a value object once that lands)

> ObjectProperty<String> and StringProperty use different equality mechanisms 
> currently, which can be very confusing. This is also true with the Integer 
> case (and other numbers), but since Integer will become a value object 
> eventually, == will start returning true on cases that were false previously.

Arguably, `StringProperty` should have used `==` for the invalidation check 
(perhaps that is still reasonable to change later).  I'm fine that the 
`Integer` cases will start working "correctly" (but differently) once that 
lands, but that shouldn't break anybody (ie. you won't get an invalidation 
anymore for a different `Integer` box that held the same value).

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r4177248102

Reply via email to