2a11fe3
From ea64c5b59f5f820a73ab3e82b6898762e55a8719 Mon Sep 17 00:00:00 2001
ded3036
From: Michael Simacek <msimacek@redhat.com>
ded3036
Date: Mon, 16 Mar 2015 16:42:20 +0100
56bf836
Subject: [PATCH 2/3] Deal with nulls from getComment
ded3036
ded3036
---
ded3036
 .../annotations/JavaAnnotationsMojoDescriptorExtractor.java         | 6 +++---
ded3036
 .../extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java       | 4 ++--
ded3036
 2 files changed, 5 insertions(+), 5 deletions(-)
ded3036
ded3036
diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java
2a11fe3
index 231ed12..6ac677b 100644
ded3036
--- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java
ded3036
+++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/JavaAnnotationsMojoDescriptorExtractor.java
ded3036
@@ -269,7 +269,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
2a11fe3
             MojoAnnotationContent mojoAnnotationContent = entry.getValue().getMojo();
2a11fe3
             if ( mojoAnnotationContent != null )
2a11fe3
             {
2a11fe3
-                mojoAnnotationContent.setDescription( javaClass.getComment() );
2a11fe3
+                mojoAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" );
2a11fe3
 
2a11fe3
                 DocletTag since = findInClassHierarchy( javaClass, "since" );
2a11fe3
                 if ( since != null )
ded3036
@@ -300,7 +300,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
2a11fe3
                 }
2a11fe3
 
2a11fe3
                 ParameterAnnotationContent parameterAnnotationContent = parameter.getValue();
2a11fe3
-                parameterAnnotationContent.setDescription( javaField.getComment() );
2a11fe3
+                parameterAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" );
2a11fe3
 
2a11fe3
                 DocletTag deprecated = javaField.getTagByName( "deprecated" );
2a11fe3
                 if ( deprecated != null )
ded3036
@@ -326,7 +326,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
2a11fe3
                 }
2a11fe3
 
2a11fe3
                 ComponentAnnotationContent componentAnnotationContent = component.getValue();
2a11fe3
-                componentAnnotationContent.setDescription( javaField.getComment() );
2a11fe3
+                componentAnnotationContent.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" );
2a11fe3
 
2a11fe3
                 DocletTag deprecated = javaField.getTagByName( "deprecated" );
2a11fe3
                 if ( deprecated != null )
ded3036
diff --git a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java
2a11fe3
index 137d90d..36b30dc 100644
ded3036
--- a/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java
ded3036
+++ b/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/javadoc/JavaJavadocMojoDescriptorExtractor.java
ded3036
@@ -115,7 +115,7 @@ public class JavaJavadocMojoDescriptorExtractor
2a11fe3
         ExtendedMojoDescriptor mojoDescriptor = new ExtendedMojoDescriptor();
2a11fe3
         mojoDescriptor.setLanguage( "java" );
2a11fe3
         mojoDescriptor.setImplementation( javaClass.getFullyQualifiedName() );
2a11fe3
-        mojoDescriptor.setDescription( javaClass.getComment() );
2a11fe3
+        mojoDescriptor.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" );
2a11fe3
 
2a11fe3
         // ----------------------------------------------------------------------
2a11fe3
         // Mojo annotations in alphabetical order
ded3036
@@ -392,7 +392,7 @@ public class JavaJavadocMojoDescriptorExtractor
2a11fe3
 
2a11fe3
             pd.setType( type.getFullyQualifiedName() );
2a11fe3
 
2a11fe3
-            pd.setDescription( field.getComment() );
2a11fe3
+            pd.setDescription( javaClass.getComment() != null ? javaClass.getComment() : "" );
2a11fe3
 
2a11fe3
             DocletTag deprecationTag = field.getTagByName( JavadocMojoAnnotation.DEPRECATED );
2a11fe3
 
ded3036
-- 
2a11fe3
2.14.3
ded3036