Uploaded image for project: 'Axiom'
  1. Axiom
  2. AXIOM-153

insertSiblingAfter() method doesn't set last child

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.8
    • None
    • None

    Description

      The insertSiblingAfter() method of OMNodeImpl adds a sibling after the invoked node. If the parent of these nodes is an OMElement and the user invokes the addChild() method then the added sibling is replaced. Consider the following sample.

      OMElement parent = fac.createOMElement("parent", null);

      OMElement c1 = fac.createOMElement("c1", null);
      OMElement c2 = fac.createOMElement("c2", null);
      OMElement c3 = fac.createOMElement("c3", null);

      parent.addChild(c1);
      c1.insertSiblingAfter(c2);
      parent.addChild(c3);

      System.out.println(parent);

      The correct output should be: <parent><c1 /><c2 /><c3 /></parent>

      But the we don't get the element c2. The incorrect output we get is : <parent><c1 /><c3 /></parent>

      Attachments

        1. 20080702_fix.patch
          3 kB
          Saliya Ekanayake
        2. 20080702_fix2.patch
          3 kB
          Saliya Ekanayake
        3. insertSiblingAfter_patch.patch
          2 kB
          Saliya Ekanayake
        4. insertSiblingAfter_withTest.patch
          4 kB
          Saliya Ekanayake

        Activity

          People

            veithen Andreas Veithen
            saliya Saliya Ekanayake
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: