Summary
ObserableValue
now specifies implementation behavior for equality checking in @implSpec
. Lazy implementation behavior of invalidation listeners was also moved to @implSpec
.
Problem
ObserableValue
's docs did not mention their behavior for equality checks, making it impossible for the user to know the behavior of the code they use.
Solution
Specify the behavior of equality checking in @implSpec
.
Specification
The changed paragraphs of the class docs:
* An implementation of {@code ObservableValue} may support lazy evaluation,
* which means that the value is not immediately recomputed after changes, but
* lazily the next time the value is requested (see note 1 in "Implementation Requirements").
* <p>
* An {@code ObservableValue} generates two types of events: change events and
* invalidation events. A change event indicates that the value has changed
* (see note 2 in "Implementation Requirements"). An
* invalidation event is generated if the current value is not valid anymore.
* This distinction becomes important if the {@code ObservableValue} supports
* lazy evaluation, because for a lazily evaluated value one does not know if an
* invalid value really has changed until it is recomputed. For this reason,
* generating change events requires eager evaluation while invalidation events
* can be generated for eager and lazy implementations.
and
* @implSpec <ol>
* <li> All bindings and properties in the JavaFX library support lazy evaluation.</li>
* <li> All implementing classes in the JavaFX library check for a change using reference
* equality (and not object equality, {@code Object#equals(Object)}) of the value.</li>
* </ol>
- csr of
-
JDK-8252546 Move ObservableValue's equality check and lazy evaluation descriptions to @implSpec
- Resolved