RFR: 8290310: ChangeListener events are incorrect or misleading when a nested change occurs
Michael Strauß
mstrauss at openjdk.org
Thu Jun 27 17:32:05 UTC 2024
On Mon, 24 Jul 2023 22:09:49 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:
>> modules/javafx.base/src/main/java/com/sun/javafx/binding/ListenerManager.java line 143:
>>
>>> 141: */
>>> 142: public void fireValueChanged(I instance, T oldValue) {
>>> 143: Object data = getData(instance);
>>
>> The `data` value could be passed into this method, which would save a (potentially not devirtualized) method call.
>
> Thanks, I'll look into that, it might speed up the 1 listener cases a bit. The same applies to OldValueCachingListenerManager#getValue I think. I know it isn't possible for the add/remove calls, as the data may change if they're nested, but for `fireValueChanged` I never really checked after going to this strategy.
Have you considered passing `data` directly into the method? What is your conclusion?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r1361519194
More information about the openjfx-dev
mailing list