RFR: 8290310: ChangeListener events are incorrect or misleading when a nested change occurs [v5]

Michael Strauß mstrauss at openjdk.org
Mon Feb 17 22:52:17 UTC 2025


On Mon, 17 Feb 2025 22:25:04 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> Well, I don't think it is reasonable or desired to have correct old values for these, as it would basically mean we'd need to clone the collection involved to give you a correct old value. The purpose of the old value here would be so you could do a diff and see what's changed, but these properties have their own callbacks for exactly that purpose. IMHO, it was a mistake to base these on properties; at most they should have provided invalidation + their custom diff-style callback.

We could have `ChangeListener` only be called when the list instance is changed via `listProperty.set(list)`, but not when the content is replaced with `listProperty.get().setAll(list)`. I don't think that the current behavior makes any sense at all.

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

PR Comment: https://git.openjdk.org/jfx/pull/1081#issuecomment-2664188636


More information about the openjfx-dev mailing list