Remove special chars from xml output by slawekjaranowski · Pull Request #28 · codehaus-plexus/plexus-xml

@slawekjaranowski

@slawekjaranowski

@slawekjaranowski

slawekjaranowski

@michael-o

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

@michael-o

@slawekjaranowski

@slawekjaranowski

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

michael-o

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

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

@slawekjaranowski

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

Generally no - I will cherry pick to 3.x

elharo

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();

Choose a reason for hiding this comment

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

StringBuilder builder

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

@slawekjaranowski

michael-o

elharo

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

elharo