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

XmlUtil.xmlCollapseWhitespace() throws StringIndexOutOfBoundsException on empty attribute #180

Closed
armay opened this issue Oct 3, 2023 · 2 comments
Labels
bug Something isn't working indev The issue is fixed/implemented in the dev branch

Comments

@armay
Copy link

armay commented Oct 3, 2023

Hi @pdvrieze, I faced a small bug in the latest version (0.86.2; 0.86.1 is not affected). The following line ends up with a StringIndexOutOfBoundsException if original: String is empty:

if (last == ' ') this.deleteAt(this.length - 1) // make sure to trim

@pdvrieze pdvrieze added indev The issue is fixed/implemented in the dev branch bug Something isn't working labels Oct 3, 2023
@pdvrieze
Copy link
Owner

pdvrieze commented Oct 3, 2023

Just fixed it. Thanks for the report. This is indeed new code, taken from my work on xml schema support (that requires support for collapsing whitespace). In terms of serialization it is used for/needed for supporting attribute lists and attribute maps.

@armay
Copy link
Author

armay commented Oct 4, 2023

Thanks a lot for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working indev The issue is fixed/implemented in the dev branch
Projects
None yet
Development

No branches or pull requests

2 participants