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

Premature END_DOCUMENT event generated by OMStAXWrapper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2.12
    • 1.2.13
    • DOOM, LLOM
    • None

    Description

      In some cases, the XMLStreamReader returned by OMContainer#getXMLStreamReader generates a premature END_DOCUMENT event.

      This occurs when all of the following conditions are met:

      1. Caching is turned off.
      2. The subtree contains elements that have the same name as the element on which getXMLStreamReader is invoked (example:. <element><element><element/><element/></element></element>).
      3. The subtree is partially built.

      The root cause can be traced back to an incorrect fix for AXIOM-151 which introduced the following code in OMStAXWrapper (see r552397):

      //this is a potential place for bugs
      //we have to test if the root node of this parser
      //has the same name for this test
      if (currentEvent == START_ELEMENT &&
      (parser.getLocalName().equals(((OMElement)rootNode).getLocalName()))) {
      ++depth;
      } else if (currentEvent == END_ELEMENT &&
      (parser.getLocalName().equals(((OMElement)rootNode).getLocalName())) ) {
      --depth;
      if (depth < 0)

      { state = COMPLETED; }

      }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: