maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r417118 - /maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
Date Mon, 26 Jun 2006 03:27:24 GMT
Author: epunzalan
Date: Sun Jun 25 20:27:24 2006
New Revision: 417118

URL: http://svn.apache.org/viewvc?rev=417118&view=rev
Log:
improved the printed message when there are no errors found

Modified:
    maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java

Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java?rev=417118&r1=417117&r2=417118&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
(original)
+++ maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java
Sun Jun 25 20:27:24 2006
@@ -19,11 +19,11 @@
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.methods.HeadMethod;
-import org.apache.maven.model.License;
 import org.apache.maven.model.IssueManagement;
+import org.apache.maven.model.License;
+import org.apache.maven.model.Organization;
 import org.apache.maven.model.Prerequisites;
 import org.apache.maven.model.Scm;
-import org.apache.maven.model.Organization;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -173,30 +173,34 @@
     {
         String messages;
         StringBuffer buffer = new StringBuffer();
-        buffer.append( "\nThe following documentation problems were found:\n" );
 
-        for ( Iterator it = errors.entrySet().iterator(); it.hasNext(); )
+        if ( errors.size() > 0 )
         {
-            Map.Entry entry = (Map.Entry) it.next();
-
-            MavenProject project = (MavenProject) entry.getKey();
-            DocumentationReporter reporter = (DocumentationReporter) entry.getValue();
+            buffer.append( "\nThe following documentation problems were found:\n" );
 
-            if ( !reporter.getMessages().isEmpty() )
+            for ( Iterator it = errors.entrySet().iterator(); it.hasNext(); )
             {
-                buffer.append( "\no " ).append( project.getName() );
-                buffer.append( " (" ).append( reporter.getMessagesByType( DocumentationReport.TYPE_ERROR
).size() )
-                      .append( " errors," );
-                buffer.append( " " ).append( reporter.getMessagesByType( DocumentationReport.TYPE_WARN
).size() )
-                      .append( " warnings)" );
-                for ( Iterator errorIterator = reporter.getMessages().iterator(); errorIterator.hasNext();
)
+                Map.Entry entry = (Map.Entry) it.next();
+
+                MavenProject project = (MavenProject) entry.getKey();
+                DocumentationReporter reporter = (DocumentationReporter) entry.getValue();
+
+                if ( !reporter.getMessages().isEmpty() )
                 {
-                    String error = (String) errorIterator.next();
+                    buffer.append( "\no " ).append( project.getName() );
+                    buffer.append( " (" ).append( reporter.getMessagesByType( DocumentationReport.TYPE_ERROR
).size() )
+                          .append( " errors," );
+                    buffer.append( " " ).append( reporter.getMessagesByType( DocumentationReport.TYPE_WARN
).size() )
+                          .append( " warnings)" );
+                    for ( Iterator errorIterator = reporter.getMessages().iterator(); errorIterator.hasNext();
)
+                    {
+                        String error = (String) errorIterator.next();
 
-                    buffer.append( "\n\t" ).append( error );
-                }
+                        buffer.append( "\n\t" ).append( error );
+                    }
 
-                buffer.append( "\n" );
+                    buffer.append( "\n" );
+                }
             }
         }
 



Mime
View raw message