RFR: 8252936: Optimize removal of listeners from ExpressionHelper.Generic

dannygonzalez github.com+6702882+dannygonzalez at openjdk.java.net
Fri Mar 5 16:05:28 UTC 2021


On Wed, 12 Feb 2020 11:29:24 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:

> hmm ... wouldn't the change violate spec of adding listeners:
> 
> > If the same listener is added more than once, then it will be notified more than once.

True, I hadn't read that spec in ObservableValueBase. 
Although that does seem odd behaviour to me. Obviously as the original implementation was using an array I can see how the implementation drove that specification.

Non of the JavaFx unit tests test for that specific case as the unit tests all passed. It would be nice if there was a specific test case for this behaviour.

I would need to store a registration count for each listener to satisfy this requirement.

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

PR: https://git.openjdk.java.net/jfx/pull/108


More information about the openjfx-dev mailing list