On Sun, 9 Apr 2023 20:53:48 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

>> That's not really useful as there is no way to make such a fluent binding 
>> valid again (it would invalidate once, and never become valid).  The only 
>> way to make it valid would be to assign the result of `map` to a variable, 
>> and call `get` on that.
>> 
>> I can however add a test that proves the above :)
>
> Also, the test is specifically looking how often `map` is called here (which 
> is triggered by invalidations from the `when`).  The listener is only there 
> to make sure that `map` has installed its listeners as fluent observables 
> don't install them when not observed themselves.  I could have used an 
> `InvalidationListener` here for this purpose, but then I'd still need to call 
> `getValue` on the `map` observable as otherwise it will definitely not map 
> anything as it is invalid.
> 
> Perhaps a simple test that shows this is the case can be useful.

I've added a variant with an InvalidationListener directly on the when binding. 
 It works as I would expect, it's maybe a more useful test than the others (it 
basically tests the same thing, but more directly).

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1056#discussion_r1161342589

Reply via email to