Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ListBasedXMLEventReader.getElementText()' doesn't work [SPR-17233] #21766

Closed
spring-issuemaster opened this issue Sep 1, 2018 · 3 comments
Closed
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Sep 1, 2018

aholowko opened SPR-17233 and commented

The StaxUtils.createXMLEventReader(events) method returns the implementation of XMLEventReader which works incorrectly.
The problem is in the getElementText method. It throws the XMLStreamException with the message 'Not at START_ELEMENT' even when the reader is at valid position with START_ELEMENT. In the javadoc of the XMLEventReader interface we can read: Precondition: the current event is START_ELEMENT.
Current implementation uses method peek() to verify the current event, but the peek method return the next event not the current.


Affects: 5.0.8

Referenced from: pull request #1948

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 1, 2018

aholowko commented

I created PR with proposal of the fix: #1948

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 7, 2018

Juergen Hoeller commented

I've addressed this through a refactoring between AbstractXMLEventReader and ListBasedXMLEventReader, with all concrete stream processing code moving to the subclass and a corresponding check added to getElementText() now.

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 8, 2018

aholowko commented

Thanks, looking forward to have a official release with those changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.