RFR: 8290310: ChangeListener events are incorrect or misleading when a nested change occurs [v11]
John Hendrikx
jhendrikx at openjdk.org
Wed Mar 12 01:32:11 UTC 2025
On Wed, 12 Mar 2025 00:35:10 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> modules/javafx.base/src/main/java/com/sun/javafx/binding/OldValueCachingListenerManager.java line 168:
>>
>>> 166: * can be {@code null} which means there are no listeners to notify
>>> 167: */
>>> 168: public void fireValueChanged(I instance, Object listenerData) {
>>
>> Same comments. `null` check on `instance`?
>
> Is a switch expression on `listenerData` not suitable here?
This is a really hot code path, and the current version came out best in the benchmarks. I didn't try modify this one for that reason. I did try for the `removeListener` code (as performance is irrelevant there), but it was a poor fit for `switch` (duplicate cases, duplicate code, and can't do fall through or multiple options with `when` expressions it seems...)
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r1990388631
More information about the openjfx-dev
mailing list