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

Adding null children leads to wrong exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • None
    • 8
    • javafx
    • None

      I just added a list of children to a group node and got the exception below. While the exception is right that something is indeed wrong, the exception is not accurate. What I added was a list of children containing null values, as in [null, null, someElement, null, null], so the only duplicate elements added was the null-values themselves. In this case, I recommend throwing a new NullChildrenNotAllowedException which would be easier to debug.



      java.lang.IllegalArgumentException: Children: duplicate children added: parent = Showcase$2@7287812
      at javafx.scene.Parent$1.onProposedChange(Parent.java:307)
      at com.sun.javafx.collections.VetoableObservableList.addAll(VetoableObservableList.java:106)
      at com.sun.javafx.collections.ObservableListWrapper.addAll(ObservableListWrapper.java:160)
      at com.intuism.ui.component.showcase.SlotConstructionTask$3.run(SlotConstructionTask.java:139)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)

            lnerad Ľubomír Nerád (Inactive)
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: