RFR: 8351276: Prevent redundant computeValue calls when a chain of mappings becomes observed

John Hendrikx jhendrikx at openjdk.org
Fri Mar 7 22:45:00 UTC 2025


On Fri, 7 Mar 2025 21:46:03 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> 8351276: Prevent redundant computeValue calls when a chain of mappings becomes observed
>
> modules/javafx.base/src/main/java/com/sun/javafx/binding/LazyObjectBinding.java line 62:
> 
>> 60:         updateSubscriptionBeforeAdd();
>> 61: 
>> 62:         super.addListener(listener);
> 
> I noticed that reverting this change causes all the `GivenAQuadMappedObservable` to fails, but reverting the add `ChangeListener` method change causes only change listener tests to fail. Is this correct? Shouldn't there be a tests that fails just the invalidation listener code?

The lazy Bindings all use invalidation listeners internally, so there will always be some invalidation listeners in these cases.  There is the listener that the user adds (invalidation, change or the subscription variants that use one of these), and there are the 4 internal invalidation listeners needed to support the 4 mappings which are added and removed when observed only.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1730#discussion_r1985807316


More information about the openjfx-dev mailing list