Skip to content

Conversation

belingueres
Copy link
Contributor

Changed concatenation expression in endElement() method to avoid the Java 7 bug.
Added test to detect if the bug is present.

(Java 1.7 only)

Changed concatenation expression in endElement() method to avoid the
Java 7 bug.
Added test to detect if the bug is present.
// TODO: change the below code to a more efficient expression when the library
// be ready to target Java 8.
String element = elementStack.removeLast();
write( "</" + element + ">" );
Copy link
Member

Choose a reason for hiding this comment

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

Nice unittest! This also confirms that the following works too:

        write( "</" );
        write( elementStack.removeLast() );
        write( ">" );

I prefer this, since it removes the variable creation and assignment explicitly.

Copy link
Member

Choose a reason for hiding this comment

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

The comment is now out of sync, i.e.

removed the element into a variable first

:)

@rfscholte rfscholte merged commit 571340b into codehaus-plexus:master Dec 1, 2018
@hboutemy hboutemy added this to the 3.1.1 milestone Mar 10, 2019
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.

3 participants