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

One and only one MapPropertyBase<K,V> change listener works.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8u121
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
      None
    • Environment:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_10

      Description

      SimpleMapProperty<String, String> map = new SimpleMapProperty<>(FXCollections.observableHashMap());

      Add several change listeners and modify the map. Nothing happens.

      Example code attached.

      Expected output:

      Map Listener 1
      Map Listener 2
      Map Listener 3
      Boolean Listener 1
      Boolean Listener 2
      Boolean Listener 3

      Actual:

      Boolean Listener 1
      Boolean Listener 2
      Boolean Listener 3

      If any 2 of 3 map listeners are commented out, remaining single listener works. All 3 boolean property listeners work fine.

      Workaround is to bind another SimpleMapProperty and add listener there. This trick works as many times as required.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kcr Kevin Rushforth
                Reporter:
                ppantele Petr Panteleyev (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: