Skip to content

#57 Uncaught IllegalArgumentException due to malformed unicode entity ref - #58

Closed
belingueres wants to merge 2 commits into
codehaus-plexus:masterfrom
belingueres:ISSUE-57
Closed

#57 Uncaught IllegalArgumentException due to malformed unicode entity ref#58
belingueres wants to merge 2 commits into
codehaus-plexus:masterfrom
belingueres:ISSUE-57

Conversation

@belingueres

Copy link
Copy Markdown
Contributor
  • Added a more readable error message by means of a
    XmlPullParserException.
  • Improved validation of the numeric character reference, according to
    XML 1.0 spec. (https://www.w3.org/TR/REC-xml/#NT-Char)

ref

- Added a more readable error message by means of a
XmlPullParserException.
- Improved validation of the numeric character reference, according to
XML 1.0 spec. (https://www.w3.org/TR/REC-xml/#NT-Char)

@hboutemy hboutemy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a good catch, I'd like to integrate the change for version 3.2.0
can you have a look at 2 comments, please?

char ch = more();
StringBuilder sb = new StringBuilder();
StringBuilder sb16 = new StringBuilder();
StringBuilder sb10 = new StringBuilder();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating 2 separate string buffers, keeping sb and creating a "isHex" boolean would be a little bit more efficient and permit code sharing between the 2 cases since it's only a question of radix value, isn't it?

Comment thread src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java
- Replaced two StringBuiders by one, added isHex boolean.
- Added tests for valid char references.
- Catched and fixed wrong parsing bug for decimal >= &#10000
(supplemental) char refs.
@hboutemy

Copy link
Copy Markdown
Member

squashed and merged 1dafbae
thank you for this great work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants