RFR: 8196065: ListChangeListener getRemoved() returns items that were not removed. [v6]

Jeanette Winzenburg fastegal at openjdk.java.net
Sat May 29 09:25:17 UTC 2021


On Fri, 28 May 2021 23:30:33 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> well, false greens are the worst we can have, IMO :). I think the test should concentrate on the isolated selectedItems behavior which __must__ propagate all notifications that it receives (from indices) in terms of items. If it fails to do so, it's a failure of its own implementation and should produce a failing test. 
>> 
>> Consider two scenarios: 
>> 
>> A: indices firing 2 separate changes
>> 
>>     selectedIndices.replaceAll(i -> i == 0 ? 1 : 0);
>>     assertEquals(2, changes.size());
>>     assertEquals(change(replaced(0, range("foo"), range("bar"))), changes.get(0));
>>     assertEquals(change(replaced(1, range("bar"), range("foo"))), changes.get(1));
>> 
>> B: indices firing a composed change:
>> 
>>     selectedIndices._beginChange();
>>     selectedIndices.replaceAll(i -> i == 0 ? 1 : 0);
>>     selectedIndices._endChange();
>>     assertEquals(indicesChanges.size(), changes.size());
>>     assertEquals(1, changes.size());
>>     assertEquals(change(replaced(0, range("foo", "bar"), range("bar", "foo"))), changes.get(0));
>> 
>> B passes both before and after the fix, A fails both before and after the fix. Whether or not that can be helped currently, is a different story. If can't be solved right now, I would suggest to keep it failing, file an issue about it and ignore the test with the issue id.
>
> I disabled the tests until the underlying [issue](https://bugs.openjdk.java.net/browse/JDK-8267951) is fixed.

Would suggest to make them correct before ignoring - expected are the exact analogue of those fired by selectedIndices (which is two in the test setup)

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

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


More information about the openjfx-dev mailing list