Axiom
  1. Axiom
  2. AXIOM-432

Updating the last child is not correct unless we are replacing the last child

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.14
    • Component/s: DOOM
    • Labels:
      None

      Description

      I have a simple policy which encrypts a header. When the WSS for J decrypts I could see in the Dom model the decrypted header. Actually I have 3 headers of which one is encrypted in the Dom model. I see all the 3 headers after it is decrypted.
      But when it is converted into the OOM model some of the headers disappear.

      soapHeader.addHeaderBlock(element.getLocalName(), element.getNamespace()); statement

      I noticed that the lastChild field of the SOAPHeader block points to a header element somewhere in the middle of the list instead of the last one
      meaning if the Header block contains 3 headers HDR1 -> HDR2 -> HDR3
      then the lastChild should point to HDR3; instead it points to HDR2
      so when a new header HDR4 is added, instead of the list becoming HDR1 -> HDR2 -> HDR3 -> HDR4
      it becomes HDR1 -> HDR2 -> HDR4 skipping HDR3

      The defect is in org.apache.axiom.om.impl.dom.ParentNode.replaceChild(Node, Node) ,line 414, where
      updating the last child is not correct unless we are replacing the last child.

      1. axiom432-test.zip
        10 kB
        Detelin Hadzhiev

        Activity

        Detelin Hadzhiev created issue -
        Detelin Hadzhiev made changes -
        Field Original Value New Value
        Attachment axiom432-test.zip [ 12536604 ]
        Andreas Veithen made changes -
        Fix Version/s 1.2.14 [ 12318340 ]
        Andreas Veithen made changes -
        Assignee Andreas Veithen [ veithen ]
        Andreas Veithen made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Andreas Veithen made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Detelin Hadzhiev
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development