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

VirtualFlow uses forEach

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u40
    • 8u40
    • javafx

      com.sun.javafx.scene.control.skin.VirtualFlow internally uses the forEach method for looping over children of an ObservableList.
      This won't work on Android/iOS at the moment. I would propose to change this in an external loop, as it won't affect performance imo:

      diff -r d6737b9de73c modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java
      --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java Tue Nov 25 14:49:19 2014 +0100
      +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java Tue Nov 25 17:59:48 2014 +0100
      @@ -1771,7 +1771,9 @@
                       // screen reader.
                       accumCell.setAccessibleRole(AccessibleRole.NODE);
                       accumCell.getChildrenUnmodifiable().addListener((Observable c) -> {
      - accumCell.getChildrenUnmodifiable().forEach(n -> n.setAccessibleRole(AccessibleRole.NODE));
      + for (Node n : accumCell.getChildrenUnmodifiable()) {
      + n.setAccessibleRole(AccessibleRole.NODE);
      + }
                       });
                   }

            jgiles Jonathan Giles
            jvos Johan Vos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: