On Sun, 25 Apr 2021 15:35:58 GMT, mstr2 <github.com+43553916+ms...@openjdk.org> 
wrote:

>> This PR fixes the implementation of `ControlUtils.reducingChange`, which 
>> incorrectly computed adjacent removed indices, thus resulting in incorrect 
>> removal notifications.
>> 
>> Since there were no unit tests for this method, I also added a bunch of 
>> tests.
>> 
>> After applying this fix, I can no longer reproduce 
>> [JDK-8189354](https://bugs.openjdk.java.net/browse/JDK-8189354) and 
>> [JDK-8189228](https://bugs.openjdk.java.net/browse/JDK-8189228).
>
> mstr2 has updated the pull request incrementally with two additional commits 
> since the last revision:
> 
>  - Revert changes to MockListObserver
>  - Removed ControlUtils.reducingChange

You're right that removing `ControlUtils.reducingChange` is enough to solve the 
problem. Maybe the method was created because it might be confusing that, while 
the indices are often not adjacent, they _are_ (as you correctly say) adjacent 
with respect to `selectedIndices`.

I have tested the change with 
[8189354](https://bugs.openjdk.java.net/browse/JDK-8189354) and 
[8189228](https://bugs.openjdk.java.net/browse/JDK-8189228), and both issues 
seem to be solved.

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

PR: https://git.openjdk.java.net/jfx/pull/480

Reply via email to