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

NullPointerException in MXParser #34

Closed
rohanpadhye opened this issue Mar 10, 2018 · 1 comment
Closed

NullPointerException in MXParser #34

rohanpadhye opened this issue Mar 10, 2018 · 1 comment
Assignees
Milestone

Comments

@rohanpadhye
Copy link

Found this bug when testing Maven:

echo -n "<Y" > npe.xml  # File contains only '<Y' without newlines
mvn -f npe.xml

When using Maven 3.5.2 / plexus-utils 3.1.0, this throws an internal error:

Caused by: java.lang.NullPointerException
	at org.codehaus.plexus.util.xml.pull.MXParser.fillBuf(MXParser.java:3054)
	at org.codehaus.plexus.util.xml.pull.MXParser.more(MXParser.java:3080)
	at org.codehaus.plexus.util.xml.pull.MXParser.parseStartTag(MXParser.java:1776)
	at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog(MXParser.java:1517)
	at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:1436)
	at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1131)
	at org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx.read(MavenXpp3ReaderEx.java:4399)
	at org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx.read(MavenXpp3ReaderEx.java:598)

Test case was generated automatically by JQF

@michael-o
Copy link
Member

Very interesting case, thx.

belingueres referenced this issue in belingueres/plexus-utils Dec 5, 2018
Modified MXParser to throw an EOFException with a more informative
message than the NPE. Added some tests.
hboutemy pushed a commit that referenced this issue Mar 10, 2019
Modified MXParser to throw an EOFException with a more informative
message than the NPE. Added some tests.
@hboutemy hboutemy added this to the 3.2.0 milestone Mar 10, 2019
@hboutemy hboutemy self-assigned this 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