-
Bug
-
Resolution: Fixed
-
P4
-
8u60
-
8u60b5
another variant of incorrect change notification from selectedIndices/Items: doesn't report all of the additions. Below is a failing test snippet (nearly standalone, the complete tests are in MultipleSelectionIssues, as always ;-) for selectedIndices
/**
* Test list change of selectedIndices on setIndices. Fails for core ..
*/
@Test
public void testEventIndicesOnSelectIndices() {
if (!multipleMode) return;
int[] indices = new int[]{2, 5, 7};
ListChangeListener l = c -> {
int subChanges = 0;
while(c.next()) {
subChanges++;
}
assertEquals(1, subChanges);
c.reset();
c.next();
assertEquals(indices.length, c.getAddedSize());
};
getSelectionModel().getSelectedIndices().addListener(l);
getSelectionModel().selectIndices(indices[0], indices);
}
/**
* Test list change of selectedIndices on setIndices. Fails for core ..
*/
@Test
public void testEventIndicesOnSelectIndices() {
if (!multipleMode) return;
int[] indices = new int[]{2, 5, 7};
ListChangeListener l = c -> {
int subChanges = 0;
while(c.next()) {
subChanges++;
}
assertEquals(1, subChanges);
c.reset();
c.next();
assertEquals(indices.length, c.getAddedSize());
};
getSelectionModel().getSelectedIndices().addListener(l);
getSelectionModel().selectIndices(indices[0], indices);
}