Axiom
  1. Axiom
  2. AXIOM-153

insertSiblingAfter() method doesn't set last child

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.8
    • Component/s: None
    • Labels:
      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>

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

        Activity

        Hide
        Saliya Ekanayake added a comment -

        The patch contains the fix to the particular issue

        Show
        Saliya Ekanayake added a comment - The patch contains the fix to the particular issue
        Hide
        Saliya Ekanayake added a comment -

        Previous patch is now updated to include a test case

        Show
        Saliya Ekanayake added a comment - Previous patch is now updated to include a test case
        Hide
        Saliya Ekanayake added a comment -

        The recent patch now introduces conflicts. This is the fixed version of it.

        Show
        Saliya Ekanayake added a comment - The recent patch now introduces conflicts. This is the fixed version of it.
        Hide
        Saliya Ekanayake added a comment -

        fixed some issues with the previous patch

        Show
        Saliya Ekanayake added a comment - fixed some issues with the previous patch
        Hide
        Andreas Veithen added a comment -

        Saliya,

        I fixed OMNodeImpl#insertSiblingAfter as well as DOOM's ChildNode#insertSiblingAfter which had the same issue. I integrated your test case into OMElementTestBase, so that it gets executed for all OM implementations. Thanks for you contribution!

        Show
        Andreas Veithen added a comment - Saliya, I fixed OMNodeImpl#insertSiblingAfter as well as DOOM's ChildNode#insertSiblingAfter which had the same issue. I integrated your test case into OMElementTestBase, so that it gets executed for all OM implementations. Thanks for you contribution!

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Saliya Ekanayake
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development