Author: dennisl Date: Mon Jun 26 15:57:31 2006 New Revision: 417310 URL: http://svn.apache.org/viewvc?rev=417310&view=rev Log: Pretty-print the summary: one error - many errors, one warning - many warnings
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=417310&r1=417309&r2=417310&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 Mon Jun 26 15:57:31 2006 @@ -188,10 +188,12 @@ if ( !reporter.getMessages().isEmpty() ) { 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)" ); + int numberOfErrors = reporter.getMessagesByType( DocumentationReport.TYPE_ERROR ).size(); + buffer.append( " (" ).append( numberOfErrors ) + .append( " error" ).append( numberOfErrors != 1 ? "s" : "" ).append( "," ); + int numberOfWarnings = reporter.getMessagesByType( DocumentationReport.TYPE_WARN ).size(); + buffer.append( " " ).append( numberOfWarnings ) + .append( " warning" ).append( numberOfWarnings != 1 ? "s" : "" ).append( ")" ); for ( Iterator errorIterator = reporter.getMessages().iterator(); errorIterator.hasNext(); ) { String error = (String) errorIterator.next();