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

TableView: selectedIndices fires incorrect change on items modification

XMLWordPrintable

      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


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

              Created:
              Updated:
              Resolved:
              Imported: