Axiom
  1. Axiom
  2. AXIOM-78

Problems in OMElemente.getChildrenWithName() and OMElement.getChildElements()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Any

      Description

      I've the following xml,
      ...
      <mtomSample>
      <image>
      <xop:include ....../>
      <image>
      <fileName>location</fileName>
      </mtomSample>
      ...

      <image/> is a binary node and <fileName/> is a regular node.

      say i have obtained the mtomSample element,

      Then if i say

      Iterator _ite1 = mtomSample.getChildrenWithName(new Qname("image")); I'm getting the image elements. Assume i extracted the OMText (binary) out of it.

      Now if i say

      Iterator _ite2 = mtomSample.getChildrenWithName(new Qname("fileName")); i should be getting a collection of "fileName" elements. Instead it's pointing again to the "image" element collection.

      If i do _ite2 first and then _ite1, then it's always pointing to the "fileName" element collection.

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Now if i say mtomSample.getChildElements(), and when getting the elements out of the iterator, it only contains <image/> element. No <fileName/> element is present in the iterator.

      now if i change the order as,

      <mtomSample>
      <fileName>location</fileName>
      <image>
      <xop:include ....../>
      <image>
      </mtomSample>

      and do mtomSample.getChildElements() ; i'm getting all the child elements perfectly.

      Seems there is a slight inconsistency in the prior two OMElement iterators.

      Thank you

      Saminda

        Activity

        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #667 (See https://builds.apache.org/job/ws-axiom-trunk/667/)

        • Removed the old test cases for AXIOM-78 which failed to provide evidence for the issue.
        • Added a regression test for AXIOM-78 and AXIOM-172.

        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetChildrenWithNameNextWithoutHasNext.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #667 (See https://builds.apache.org/job/ws-axiom-trunk/667/ ) Removed the old test cases for AXIOM-78 which failed to provide evidence for the issue. Added a regression test for AXIOM-78 and AXIOM-172 . veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetChildrenWithNameNextWithoutHasNext.java
        Hide
        Andreas Veithen added a comment -

        The issue actually occurred with the iterator returned by getChildrenWithName when calling Iterator#next() without calling Iterator#hasNext() before. This was fixed in 1.2.11 by AXIOM-172.

        Show
        Andreas Veithen added a comment - The issue actually occurred with the iterator returned by getChildrenWithName when calling Iterator#next() without calling Iterator#hasNext() before. This was fixed in 1.2.11 by AXIOM-172 .
        Hide
        Eran Chinthaka added a comment -

        Already fixed.

        Show
        Eran Chinthaka added a comment - Already fixed.
        Hide
        Eran Chinthaka added a comment -

        Hi Saminda,

        I wrote a test case to test both of the scenarios you explained here, but I can not see the bug you have mentioned here. Can you please check on org.apache.axiom.om.IteratorTest.testScenariosInJIRA() test and let us know the status?

        – Chinthaka

        Show
        Eran Chinthaka added a comment - Hi Saminda, I wrote a test case to test both of the scenarios you explained here, but I can not see the bug you have mentioned here. Can you please check on org.apache.axiom.om.IteratorTest.testScenariosInJIRA() test and let us know the status? – Chinthaka

          People

          • Assignee:
            Eran Chinthaka
            Reporter:
            Saminda Wishwajith Abeyruwan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development