[jfx19] RFR: 8290331 Binding value left null when immediately revalidated in invalidation listener

Nir Lisker nlisker at openjdk.org
Fri Jul 15 13:57:03 UTC 2022


On Thu, 14 Jul 2022 23:55:52 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> I introduced a bug with the fluent bindings PR which affects all ObjectBindings.
>> 
>> This is the code that fails:
>> 
>>         SimpleObjectProperty<Boolean> condition = new SimpleObjectProperty<>(true);
>>         ObservableValue<String> binding = condition.map(Object::toString);
>> 
>>         binding.addListener(o -> { binding.getValue(); });
>> 
>>         condition.set(false);
>> 
>>         assertEquals(false, binding.getValue());  // returns null (!)
>> 
>> This PR fixes this problem and adds a test case to cover it.
>
> Good catch. And yes, this needs to go into JavaFX 19.

@kevinrushforth Any idea why `/issue add` is only available to the author? If I can go to JBS and close it as a duplicate, it makes sense that I could mark it as such here. Is there some conceptual point I'm missing?

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

PR: https://git.openjdk.org/jfx/pull/829


More information about the openjfx-dev mailing list