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

SimpleListProperty incorrectly reuses ListChangeListener.Change object for different listeners

    XMLWordPrintable

Details

    Description

      SimpleListProperty incorrectly reuses ListChangeListener.Change object for different listeners. This means that only the first registered listener is able to iterate through the change events, while any subsequent listeners cannot. I would expect SimpleListProperty to behave similar compared to a ObseravleList created by FXCollections, since SimpleListProperty implements ObseravbleList.

      As far as i understand it, the output of the attached example should be as follows:

      "A: [object reference]
      B: [object reference]"

      Actual output:

      "A: [object reference]"

      This seems to be due to the fact, that both onChanged methods are invoked with the same ListChangeListener.Change object (which seems reasonable), but without having it reset (which seems unreasonable). Therefore, listeners after the first listener are not able to evaluate the change event in the same way, the first listener was.

      Attachments

        Issue Links

          Activity

            People

              mheinrichs Michael Heinrichs (Inactive)
              pcorneliujfx Philipp Cornelius (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: