[ http://issues.apache.org/jira/browse/AXIS2-818?page=all ]

Ajith Harshana Ranabahu resolved AXIS2-818.
-------------------------------------------

    Resolution: Fixed

Changed the implementation of the wrapper to fix this issue. Basically the 
intention of the wrapper is to produce a fake START_DOCUMENT event if the real 
parser rests at the START_ELEMENT event. Now the parser returns the 
START_DOCUMENT if the state of the internal parser has not been touched but 
never throws the START_DOCUMENT from the next method.

> org.apache.axis2.util.StreamWraper may produce START_DOCUMENT events twice
> --------------------------------------------------------------------------
>
>                 Key: AXIS2-818
>                 URL: http://issues.apache.org/jira/browse/AXIS2-818
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0
>            Reporter: Raymond Feng
>         Assigned To: Ajith Harshana Ranabahu
>
> If  StreamWrapper is used to wrap a XMLStreamReader positioned at 
> START_ELEMENT, then it will produce START_DOCUMENT events twice.
> Assuming StreamWrapper wrapper = new StreamingWrapper(realReader);
> 1) wrapper.getEventType() returns START_DOCUMENT
> 2) wrapper.next() still returns START_DOCUMENT by the logic in code below. 
> (in this case, state==STATE_INIT && realReader.getEventType() == 
> START_ELEMENT)
> public int next() throws XMLStreamException {
>         prevState = state;
>         int returnEvent = -1;
>         switch (state) {
>             case STATE_INIT:
>                 if (realReader.getEventType() == START_DOCUMENT) {
>                     state = STATE_SWITCHED;
>                     returnEvent = realReader.getEventType();
>                 } else {
>                     state = STATE_SWITCH_AT_NEXT;
>                     returnEvent = START_DOCUMENT;
>                 }
>                 break;
> ...
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to