Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094790

ListView et al: selectedIndices/Items fires incorrect event on selectIndices

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u60
    • Fix Version/s: 8u60
    • Component/s: javafx
    • Environment:

      8u60b5

      Description

      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);
          }


       

        Attachments

          Activity

            People

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            fastegal Jeanette Winzenburg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: