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

[core] XMLRenderer: ProcessingErrors from exceptions without a message missing #1471

Closed
adangel opened this Issue Nov 16, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@adangel
Copy link
Member

adangel commented Nov 16, 2018

Affects PMD Version: it's on the master branch

A ProcessingError could be a NullPointerException. If this exception is raised by the JVM, then it usually has no message.

This in turn leads to a NPE in the XMLRenderer, which then doesn't render this and the remaining errors. I think, violations are fully renderer, since they have already been processed.

Nov. 16, 2018 9:27:51 NACHM. net.sourceforge.pmd.PMD doPMD
SEVERE: Exception during processing
java.lang.NullPointerException
	at net.sourceforge.pmd.util.StringUtil.appendXmlEscaped(StringUtil.java:214)
	at net.sourceforge.pmd.renderers.XMLRenderer.end(XMLRenderer.java:126)
	at net.sourceforge.pmd.PMD.doPMD(PMD.java:244)
	at net.sourceforge.pmd.PMD.run(PMD.java:485)
	at net.sourceforge.pmd.cli.PMDCommandLineInterface.run(PMDCommandLineInterface.java:165)
	at net.sourceforge.pmd.PMD.main(PMD.java:455)

This was the reason for the strange pmdtester report on #1434, where violations have been removed (because a rule failed and was skipped) - but no additional errors have been logged:
http://chunk.io/pmd/6b7d5dbc13504a828f3a8510dd62dfcf/diff/index.html

Running PMD through: CLI

@adangel adangel added the a:bug label Nov 16, 2018

@adangel adangel added this to the 6.10.0 milestone Nov 16, 2018

@adangel adangel self-assigned this Nov 16, 2018

adangel added a commit to adangel/pmd that referenced this issue Nov 16, 2018

[core] XMLRenderer: ProcessingErrors from exceptions without a messag…
…e missing

Fixes pmd#1471

This also improves the message of the processing error by including
the exception name.

@adangel adangel added the has:pr label Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment