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

API inconsistency: getChildren().add(node) throws duplicate exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      b118, Windows 7 x64

      Description

      Earlier JavaFX was throwing an exception when node was added to the scenegraph twice.

      Currently it doesn't if the parent is different: automatic reparenting happens.

      However if the parent is the same then duplicate node exception is thrown.

      This is inconsistent and inconvenient as you always need to check whether this node is already present for this parent.

      A consistent behavior would be to move it in the children's list to the specified position (or to the end if position is not specified). Similar to removing from original parent.

        Attachments

          Activity

            People

            • Assignee:
              msladecek Martin Sládeček
              Reporter:
              mrkam Alexander Kuznetcov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: