RFR: 8331616: ChangeListener is not triggered when the InvalidationListener is removed

John Hendrikx jhendrikx at openjdk.org
Sun Oct 27 21:55:33 UTC 2024


On Fri, 3 May 2024 14:45:24 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> This PR provides a fix for the linked issue.
> 
> The issue was that when an invalidation listener is removed, and the `ExpressionHelper` type changes from `Generic` to `SingleChange` that it would copy the current value of the `Generic` instance before it was updated (this is because invalidation listeners trigger before change listeners and the current value would only be updated **after** invalidation listeners notifications were completed).
> 
> The code now will update the current value before sending out any notifications **if** there are change listeners present to head off this problem.
> 
> Added a few test cases to verify this.
> 
> Note: the PR which replaces `ExpressionHelper` does not have this problem: https://github.com/openjdk/jfx/pull/1081

@johanvos @kevinrushforth This is quite a fundamental bug introduced in 21 with properties; should we perhaps backport this somewhere?  The current 21 and 22 releases are both bugged, and 21 seems to be receiving updates still (this was fixed in may 2024 and I see that the latest release of 21 is from October).

If we're doing any kind of LTS support on 21, I really think this needs a backport.

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

PR Comment: https://git.openjdk.org/jfx/pull/1448#issuecomment-2440187394


More information about the openjfx-dev mailing list