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

can violate scene graph invariants using bind

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx1.3
    • fx1.2
    • javafx
    • None

      The changes for RT-4095 and RT-4181 enforced and documented the restrictions on how nodes can be arranged in the scene graph.

      Unfortunately, through use of the 'bind' keyword, it is possible to violate the restrictions on scene graph structure, and in the current state of the system it is not possible for library code to enforce these restrictions.

      For example, one rule is that a node cannot appear in more than one group. However, the following code does just that:

      var n:Node = null;

      var g1 = Group { content: bind [ n ] };
      var g2 = Group { content: bind [ n ] };

      n = Group { }; // or any kind of node

      When the bind-expressions fire, Node n will appear in the content sequences of both Groups, and the trigger code will be unable to prevent this from happening. An AssignToBoundExpression exception or some such will be thrown, and the invalid structure will remain. It is also possible to introduce cycles into the scene graph this way.

      We need to figure out how to deal with this issue. Some kind of language support for nullifying bind expressions, or something, is necessary.

            kcr Kevin Rushforth
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: