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. 20080702_fix2.patch
        3 kB
        Saliya Ekanayake
      2. 20080702_fix.patch
        3 kB
        Saliya Ekanayake
      3. insertSiblingAfter_withTest.patch
        4 kB
        Saliya Ekanayake
      4. insertSiblingAfter_patch.patch
        2 kB
        Saliya Ekanayake

        Activity

        Saliya Ekanayake created issue -
        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
        Saliya Ekanayake made changes -
        Field Original Value New Value
        Attachment insertSiblingAfter_patch.patch [ 12381243 ]
        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
        Saliya Ekanayake made changes -
        Attachment insertSiblingAfter_withTest.patch [ 12381851 ]
        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.
        Saliya Ekanayake made changes -
        Attachment 20080702_fix.patch [ 12385077 ]
        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
        Saliya Ekanayake made changes -
        Attachment 20080702_fix2.patch [ 12385088 ]
        Andreas Veithen made changes -
        Fix Version/s Axiom 1.2.8 [ 12313556 ]
        Andreas Veithen made changes -
        Assignee Andreas Veithen [ veithen ]
        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!
        Andreas Veithen made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Andreas Veithen made changes -
        Project WS-Commons [ 12310250 ] Axiom [ 12311190 ]
        Key WSCOMMONS-337 AXIOM-153
        Component/s AXIOM [ 12310703 ]
        Fix Version/s Axiom 1.2.8 [ 12313556 ]
        Jeff Turner made changes -
        Fix Version/s Axiom 1.2.8 [ 12315531 ]
        Andreas Veithen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development