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

Lamda ChangeListener won't get all notifications but an anonymous class will

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8u20
    • javafx
    • None
    • Linux 64-bit (Xubuntu 14.04 LTS "Trusty Tahr)
      XFCE-Desktop (based on GTK+, just like the Gnome Desktop)

      I added a selection change listener (listView.getSelectionModel().selectedItemProperty().addListener... ) on a ListView with SelectionMode.MULTIPLE set.

      When adding the listener as anonymous class, everything works as expected.
      When adding another listener as lambda expression, everything works still as expected.
      Now uncomment the first listener (anonymous class). From now on the remaining listener (lamda expression) won't get called if an existing selection gets changed while pressing the SHIFT-key (multi-selection).

      EDIT: I added an executable sample code (see next comment)

            jgiles Jonathan Giles
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: