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

PrettyPrintXMLWriter fails with a java.util.NoSuchElementException (Java 1.7 only) #51

Closed
belingueres opened this issue Nov 30, 2018 · 0 comments
Milestone

Comments

@belingueres
Copy link
Contributor

belingueres commented Nov 30, 2018

As discussed on maven developers mailing-list [1], the PrettyPrintXMLWriter fails with a NoSuchElementException when calling the endElement() method on the root XML tag.
As verified after debugging, the LinkedList implementation (used as a stack) is NOT empty: it contains one element that can be safely removed from the list, but instead it throws the exception as if that list were actually empty.

The bug arises when executing the build with JDK 7u80 and 7u79 on Windows OS (Windows 10 tested by me).
Also verified that the bug does not arises when:

  • disabling string concatenation optimizations on Java 7 (-XX:-OptimizeStringConcat).
  • executing maven with remote debugging (command mvnDebug).
  • executing maven with Java 8.

[1] https://www.mail-archive.com/dev@maven.apache.org/msg117970.html

belingueres referenced this issue in belingueres/plexus-utils Nov 30, 2018
(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.
rfscholte pushed a commit that referenced this issue Dec 1, 2018
@rfscholte rfscholte added this to the 3.2.0 milestone Dec 1, 2018
@hboutemy hboutemy modified the milestones: 3.2.0, 3.1.1 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

No branches or pull requests

3 participants