TRINIDAD-2184 - Fix NullPointerException when using Maven 3.0.3:
Caused by: java.lang.NullPointerException
at java.io.Writer.write(Writer.java:140)
at org.apache.myfaces.trinidadbuild.plugin.tagdoc.TagdocReport._writeComponentFacets(TagdocReport.java:1302)
at org.apache.myfaces.trinidadbuild.plugin.tagdoc.TagdocReport._generateComponentDoc(TagdocReport.java:562)
at org.apache.myfaces.trinidadbuild.plugin.tagdoc.TagdocReport._generateTagDocs(TagdocReport.java:218)
at org.apache.myfaces.trinidadbuild.plugin.tagdoc.TagdocReport.executeReport(TagdocReport.java:108)
diff --git a/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java b/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
index d8d6b4f..83da07d 100644
--- a/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
+++ b/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
@@ -81,7 +81,6 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
-
/**
* Report for generating JSF tagdoc based on faces-config.xml parsing.
* Note that this is not really an AbstractMavenMultiPageReport - the
@@ -143,6 +142,7 @@
// The map is built using the getSatisfiedContracts method API on the component bean to determine
// which contracts are satisfied for a given tagname
Map<String, List<QName>> contractMap = new HashMap<String, List<QName>>();
+
while (compIter.hasNext())
{
ComponentBean compBean = compIter.next();
@@ -356,14 +356,14 @@
sb.append(_getQualifiedName(tagName));
sb.append("</a>");
gotOne = true;
- }
}
}
- if (gotOne)
- {
- sb.append("<br/>\n");
- formatted = sb.toString();
- }
+ }
+ if (gotOne)
+ {
+ sb.append("<br/>\n");
+ formatted = sb.toString();
+ }
return formatted;
}
@@ -391,9 +391,9 @@
// in a separate table cell, so no header text is passed into this method
if (header != null && !header.isEmpty())
{
- sb.append("<b>");
- sb.append(header);
- sb.append(":</b> ");
+ sb.append("<b>");
+ sb.append(header);
+ sb.append(":</b> ");
}
boolean gotOne = false;
@@ -735,7 +735,7 @@
null);
out.write("<tr>\n");
out.write("<td><b>Required Ancestor Tag(s):</b></td>");
- out.write ("<td>" + formattedAncestors + "</td>");
+ out.write("<td>" + formattedAncestors + "</td>");
out.write("</tr>\n");
}
@@ -1299,8 +1299,11 @@
if (facet.hasAllowedChildComponents())
{
String formattedChildComps = _formatTagList (facet.allowedChildComponents(), compTypeMap, "Allowed Child Components");
- out.write (formattedChildComps);
- out.write("<br/>");
+ if (formattedChildComps != null)
+ {
+ out.write(formattedChildComps);
+ out.write("<br/>");
+ }
}
out.write(facet.getDescription());
@@ -1867,7 +1870,6 @@
*/
private File outputDirectory;
-
/**
* Directory where the original site is present.
* (TRIED using ${baseDir}/src/site; that inserted a 'null' into