Description
The StAX specification defines the XMLStreamReader#hasNext() method as follows:
"Returns true if there are more parsing events and false if there are no more events. This method will return false if the current state of the XMLStreamReader is END_DOCUMENT."
In some cases, the hasNext method in OMStAXWrapper/SwitchingWrapper already returns false on the event immediately preceding the END_DOCUMENT event. This means that when using a loop constructed with hasNext, the END_DOCUMENT event is missed.
Note that some code in Axis2 seems to depend on this incorrect behavior and will have to be fixed.