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

Remove special chars from xml output #28

Merged
merged 5 commits into from
May 20, 2024
Merged

Conversation

slawekjaranowski
Copy link
Member

No description provided.

@slawekjaranowski slawekjaranowski marked this pull request as draft May 17, 2024 12:32
@slawekjaranowski
Copy link
Member Author

related to: apache/maven-invoker-plugin#242

@michael-o
Copy link
Member

Looking at the code as a whole I absolutely do not understand why the framework allows to produce invalid (unescaped) XML. It simply does not make sense to me.

@michael-o
Copy link
Member

@slawekjaranowski I have pushed a naive solution to the problem. @elharo WDYT?

@slawekjaranowski
Copy link
Member Author

Next commit with removing special chars - fix build in invoker

@slawekjaranowski slawekjaranowski changed the title Testing special chars in xml output Remove special chars from xml output May 19, 2024
Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

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

Looks reasonable, but I'd like @elharo to check as well.

@michael-o
Copy link
Member

Can 4.x be used with Maven 3.x?

@slawekjaranowski
Copy link
Member Author

Can 4.x be used with Maven 3.x?

Generally no - I will cherry pick to 3.x

@slawekjaranowski slawekjaranowski marked this pull request as ready for review May 19, 2024 21:50
@slawekjaranowski slawekjaranowski requested review from gnodet and removed request for elharo May 19, 2024 21:57
Copy link

@elharo elharo left a comment

Choose a reason for hiding this comment

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

I'm not very familiar with this API or code base, but at first glance it seems OK. I would add documentation in the appropriate spots indicating that C0 controls are omitted from output.

text = escapeXml(text);

Matcher m = lowersText.matcher(text);
StringBuffer b = new StringBuffer();
Copy link

Choose a reason for hiding this comment

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

StringBuilder builder

Copy link
Member Author

Choose a reason for hiding this comment

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

appendReplacement require StringBuffer, StringBuilder is supported from JDK 9

Copy link

@elharo elharo left a comment

Choose a reason for hiding this comment

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

It occurs to me that there are also some issues in this class with unpaired surrogates, but one piece of technical arcana at a time. :-)

@slawekjaranowski slawekjaranowski merged commit c9d72af into master May 20, 2024
22 checks passed
@slawekjaranowski slawekjaranowski deleted the special-chars branch May 20, 2024 14:09
@slawekjaranowski slawekjaranowski added the bug Something isn't working label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants