axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Feng (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-818) org.apache.axis2.util.StreamWraper may produce START_DOCUMENT events twice
Date Tue, 13 Jun 2006 19:14:30 GMT
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)
        Type: Bug

  Components: core  
    Versions: 1.0    
    Reporter: Raymond Feng


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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message