Return-Path: Delivered-To: apmail-maven-commits-archive@www.apache.org Received: (qmail 60667 invoked from network); 1 Apr 2008 09:25:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Apr 2008 09:25:27 -0000 Received: (qmail 48204 invoked by uid 500); 1 Apr 2008 09:25:27 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 48134 invoked by uid 500); 1 Apr 2008 09:25:27 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 48121 invoked by uid 99); 1 Apr 2008 09:25:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 02:25:27 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 09:24:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0D4C31A9832; Tue, 1 Apr 2008 02:25:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r643334 - /maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java Date: Tue, 01 Apr 2008 09:25:02 -0000 To: commits@maven.apache.org From: hboutemy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080401092504.0D4C31A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hboutemy Date: Tue Apr 1 02:24:47 2008 New Revision: 643334 URL: http://svn.apache.org/viewvc?rev=643334&view=rev Log: [MPLUGIN-107] escape special characters from descriptions in generated java source Modified: maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java Modified: maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java?rev=643334&r1=643333&r2=643334&view=diff ============================================================================== --- maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java (original) +++ maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginHelpGenerator.java Tue Apr 1 02:24:47 2008 @@ -295,8 +295,8 @@ MojoDescriptor descriptor = (MojoDescriptor) it.next(); String goal = descriptor.getFullGoalName(); - String description = StringUtils.isNotEmpty( descriptor.getDescription() ) ? toText( descriptor - .getDescription() ) : "No description available."; + String description = StringUtils.isNotEmpty( descriptor.getDescription() ) ? + StringUtils.escape( toText( descriptor.getDescription() ) ) : "No description available."; writer.write( " sb.append( \"" + goal + "\" ).append( \"\\n\" );" + LS ); writer.write( " for ( Iterator it = toLines( \"" + description + "\" ).iterator(); it.hasNext(); )" @@ -330,10 +330,8 @@ if ( expression == null || !expression.startsWith( "${component." ) ) { String parameterName = parameter.getName(); - String parameterDescription = StringUtils.isNotEmpty( parameter.getDescription() ) - ? toText( parameter - .getDescription() ) - : "No description available."; + String parameterDescription = StringUtils.isNotEmpty( parameter.getDescription() ) ? + StringUtils.escape( toText( parameter.getDescription() ) ) : "No description available."; String parameterDefaultValue = parameterName + ( StringUtils.isNotEmpty( parameter.getDefaultValue() ) ? " (Default: '" + parameter.getDefaultValue() + "')" : "" );