-
Bug
-
Resolution: Fixed
-
P4
-
8u40
-
8u40b12
Assume (context is the same as RT-39393 but tableView's misbehaviour is different)
- multiple indices selected
- having a listener on selectedIndices
- add item to listView's items
such that f.i.
// before add item
selectedIndices = [2, 3]
// after add item
selectedIndices = [3, 4]
// listener on selectedIndices:
int counter = 0;
boolean was2Removed;
boolean was4Added;
c -> {
counter++;
while (c.next()) {
if (c.addedSubList.contains(4)) was4Added = true;
if (c.removedList() .contains(2)) was2Removed = true;
}
}
assertTrue(was4Added);
assertEquals(1, counter);
assertTrue(was2Removed);
TableView's selectedIndices passes the first assert, fails the other two.
for runnable code that prints out the actual changes, see SO http://stackoverflow.com/q/26913280/203657
- multiple indices selected
- having a listener on selectedIndices
- add item to listView's items
such that f.i.
// before add item
selectedIndices = [2, 3]
// after add item
selectedIndices = [3, 4]
// listener on selectedIndices:
int counter = 0;
boolean was2Removed;
boolean was4Added;
c -> {
counter++;
while (c.next()) {
if (c.addedSubList.contains(4)) was4Added = true;
if (c.removedList() .contains(2)) was2Removed = true;
}
}
assertTrue(was4Added);
assertEquals(1, counter);
assertTrue(was2Removed);
TableView's selectedIndices passes the first assert, fails the other two.
for runnable code that prints out the actual changes, see SO http://stackoverflow.com/q/26913280/203657
- relates to
-
JDK-8089709 ListView: selectedIndices fires incorrect change on items modification
-
- Resolved
-