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

ListPropertyBase: must not fire changeEvent on modifying the list

XMLWordPrintable

      The test below is failing. I would expect:

      - to receive a changeEvent on changing the identity of the list
      - to receive a listChangeEvent on both modifying the list and changing the identity of the list
      - to not receive a changeEvent on modifying a list

      first two expectations seem to be met (as experimented so far) but not the last. Not entirely sure, though, it the expectation is correct. ListProperty isn't used at all internally in the controls related code (which is a pity, would make listening to collection-values properties much cleaner), so no examples to learn from)

          @Test
          public void testListPropertyChangeNotificationOnRemoveItem() {
              ObservableList<String> list = createObservableList(true);
              ListProperty<String> listProperty = new SimpleListProperty<>(list);
              ChangeReport report = new ChangeReport(listProperty);
              list.remove(0);
              assertEquals("listProperty must not fire changeEvent on removing item", 0, report.getEventCount());
          }
          

            Unassigned Unassigned
            fastegal Jeanette Winzenburg
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Imported: