On Wed, 26 May 2021 08:54:30 GMT, Jeanette Winzenburg <faste...@openjdk.org> 
wrote:

> You mean `selectedIndices` not reporting truthfully?

Yes, I meant `selectedIndices`.

I'm not quite sure I understand what you're getting at. Are you suggesting to 
apply the changes reported by `selectedIndices` to our copy of the items 
(`itemsRefList`) while iterating the changeset? If so, I think that doesn't 
work because crucial `selectedIndices` notifications are missing.

For example, `selectedIndices` sometimes doesn't report removed items. By 
simply iterating over the changeset, `itemsRefList` would soon be out of sync 
with `selectedIndices`. The only way to correctly sync `itemsRefList` with 
`selectedIndices` is to discard all items, and collect them again in a bulk 
operation (like it's done currently).

That alone doesn't make `SelectedItemsReadOnlyObservableList` well-behaved: 
since its change notifications are generated while iterating over the 
`selectedIndices` changes, it will also miss some notifications.

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

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

Reply via email to