On Fri, 10 Jul 2026 18:22:11 GMT, Andy Goryachev <[email protected]> wrote:
>> John Hendrikx has updated the pull request incrementally with six additional
>> commits since the last revision:
>>
>> - Ensure change/invalidation listeners are not mixed up
>> - Clarify ArrayManager docs
>> - Update copyright year on new files
>> - Clarify occupied slots
>> - Add missing LF at end of file
>> - Sealed ListenerManagerBase
>
> modules/javafx.base/src/main/java/javafx/beans/binding/BooleanBinding.java
> line 190:
>
>> 188: public final void invalidate() {
>> 189: if (valid) {
>> 190: boolean oldValue = value;
>
> question: how does it work if you set(1)-invalidate-set(2)-invalidate ?
If you do two sets in a row (without reading the value in between) then the
sequence will be:
Assuming the binding is currently valid:
- set(1) -> invalidation fires
- set(2) -> nothing happens
Another example:
- set(1) -> invalidation fires
- get() -> binding calculates current value and becomes valid
- set(2) -> invalidation fires
Or if there is a change listener present on the binding:
- set(1) -> invalidation fires (and calls change listener)
- change listener must know current value so does a `get()`, and thus binding
becomes valid
- set(2) -> invalidation fires again
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r3562047918