case ElementSpec.JoinFractureDirection:   fracNotCreated = false; insertFracture(data[i]); if (fracNotCreated)
for (int p = 0; p < data.length && data[p].getType() == ElementSpec.EndTagType; p++)
    protected void insertUpdate(ElementSpec[] data)    {      // Push the root and the paragraph at offset onto the element stack.      Element current = root;      int index;      while (!current.isLeaf())        {          index = current.getElementIndex(offset);          elementStack.push(current);          current = current.getElement(index);        }            int i = 0;      int type = data[0].getType();      if (type == ElementSpec.ContentType)        {          // If the first tag is content we must treat it separately to allow          // for joining properly to previous Elements and to ensure that          // no extra LeafElements are erroneously inserted.          insertFirstContentTag(data);          pos += data[0].length;          i = 1;        }      else        {        createFracture(data);          i = 0;        }            // Handle each ElementSpec individually.      for (; i < data.length; i++)        {          BranchElement paragraph = (BranchElement) elementStack.peek();          switch (data[i].getType())            {            case ElementSpec.StartTagType:              switch (data[i].getDirection())                {                case ElementSpec.JoinFractureDirection:                  // Fracture the tree and ensure the appropriate element                  // is on top of the stack.                  fracNotCreated = false;                  insertFracture(data[i]);                  if (fracNotCreated)                    {                      if (lastFractured != null)                        elementStack.push(lastFractured.getParentElement());                      else                        elementStack.push(paragraph.getElement(0));                    }              break;                case ElementSpec.JoinNextDirection:                  // Push the next paragraph element onto the stack so                   // future insertions are added to it.                  int ix = paragraph.getElementIndex(pos) + 1;                  elementStack.push(paragraph.getElement(ix));              break;            default:                  Element br = null;                  if (data.length > i + 1)                    {                      // leaves will be added to paragraph later                      int x = 0;                      if (paragraph.getElementCount() > 0)                        x = paragraph.getElementIndex(pos) + 1;                      Edit e = getEditForParagraphAndIndex(paragraph, x);                      br = (BranchElement) createBranchElement(paragraph,                                                               data[i].getAttributes());                      e.added.add(br);                      elementStack.push(br);                    }                  else                    // need to add leaves to paragraph now                    br = insertParagraph(paragraph, pos);              break;            }              break;            case ElementSpec.EndTagType:          elementStack.pop();              break;            case ElementSpec.ContentType:              insertContentTag(data[i]);              offset = pos;              break;            }        }    }