maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
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 GMT
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() + "')" : "" );



Mime
View raw message