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

VirtualFlow uses forEach

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:

      Description

      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);
      + }
                       });
                   }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: