| Summary: | NullPointerException with csv format SystemPropertiesQuery and PHD | ||
|---|---|---|---|
| Product: | [Tools] MAT | Reporter: | Andrew Johnson <andrew_johnson> |
| Component: | Core | Assignee: | Andrew Johnson <andrew_johnson> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.1 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Andrew Johnson
This can also be demonstrated by running the regression.xml report from a development version of MAT with the org.eclipse.mat.test plugin loaded. doProcess will chose another outputter if required, but in this case will leave it as HtmlOutputter as we do not know which type to use for a null result. The easiest solution is to change ResultRenderer.process() to call doProcess if the outputter is HtmlOutputter rather than if the type is "html" as the alternative of doProcessAlien will always fail if the outputter is actually HtmlOutputter. We also should consider what happens if a new outputter of type "html" is created to handle a specific type of output.
@Renderer(target = "html", result = IResultTree.class)
public class HtmlOutputter2 extends HtmlOutputter
{
public void embedd(Context context, IResult result, Writer writer) throws IOException
{
writer.append("<p>A special table</p>");
super.embedd(context, result, writer);
}
}
We don't want to use doProcessAlien for these as we want it all embedded in the same report.
The test therefore is:
if ("html".equals(format) || outputter.equals(html)) //$NON-NLS-1$
The fix solved the problem. |