You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sn...@apache.org on 2007/02/02 21:28:52 UTC

svn commit: r502730 - in /maven/plugins/trunk/maven-changes-plugin: pom.xml src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java

Author: snicoll
Date: Fri Feb  2 12:28:51 2007
New Revision: 502730

URL: http://svn.apache.org/viewvc?view=rev&rev=502730
Log:
MCHANGES-65:  Fixes potential empty "due to" and "fixes" fields
Submitted by: Henning Schmiedehausen
Reviewed by: Stephane Nicoll

Modified:
    maven/plugins/trunk/maven-changes-plugin/pom.xml
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java

Modified: maven/plugins/trunk/maven-changes-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/pom.xml?view=diff&rev=502730&r1=502729&r2=502730
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-changes-plugin/pom.xml Fri Feb  2 12:28:51 2007
@@ -14,7 +14,9 @@
   ~ limitations under the License.
   
 -->
-<project xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd' xmlns='http://maven.apache.org/POM/4.0.0'>
+<project xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+         xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'
+         xmlns='http://maven.apache.org/POM/4.0.0'>
   <parent>
     <artifactId>maven-plugins</artifactId>
     <groupId>org.apache.maven.plugins</groupId>
@@ -33,7 +35,7 @@
     <url>http://jira.codehaus.org/browse/MCHANGES</url>
   </issueManagement>
   <mailingLists>
-        <!-- duplication from maven-plugins pom - temporary until they inherit properly 
+    <!-- duplication from maven-plugins pom - temporary until they inherit properly
     -->
     <mailingList>
       <name>Maven User List</name>
@@ -60,7 +62,7 @@
       <post>commits@maven.apache.org</post>
       <archive>http://mail-archives.apache.org/mod_mbox/maven-commits/</archive>
     </mailingList>
-        <!-- duplication from maven-parent pom - temporary until they inherit properly 
+    <!-- duplication from maven-parent pom - temporary until they inherit properly
     -->
     <mailingList>
       <name>Maven Announcements List</name>
@@ -123,7 +125,7 @@
       <version>1.0-alpha-2</version>
     </dependency>
     <dependency>
-            <!--  forces use of javamail 1.4 since it's the only version available in the repo. We should remove this as soon
+      <!--  forces use of javamail 1.4 since it's the only version available in the repo. We should remove this as soon
         as the dependency in plexus-mail-sender-javamail will be update  
       -->
       <groupId>javax.mail</groupId>
@@ -134,6 +136,11 @@
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-api</artifactId>
       <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.1</version>
     </dependency>
     <dependency>
       <groupId>commons-logging</groupId>

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java?view=diff&rev=502730&r1=502729&r2=502730
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java Fri Feb  2 12:28:51 2007
@@ -23,6 +23,8 @@
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.plugin.logging.Log;
 
+import org.apache.commons.lang.StringUtils;
+
 /**
  * Generates a changes report.
  *
@@ -111,11 +113,11 @@
 
             sink.rawText( action.getAction() );
 
-            if ( action.getIssue() != null )
+            if ( StringUtils.isNotEmpty( action.getIssue() ) )
             {
                 sink.text( " " + bundle.getString( "report.changes.text.fixes" ) + " " );
 
-                if ( this.url == null || this.url.trim().equals( "" ) )
+                if ( StringUtils.isEmpty( url ) )
                 {
                     sink.text( action.getIssue() );
 
@@ -134,11 +136,11 @@
                 sink.text( "." );
             }
 
-            if ( action.getDueTo() != null )
+            if ( StringUtils.isNotEmpty( action.getDueTo() ) )
             {
                 sink.text( " " + bundle.getString( "report.changes.text.thanx" ) + " " );
 
-                if ( action.getDueToEmail() != null )
+                if ( StringUtils.isNotEmpty( action.getDueToEmail() ) )
                 {
                     sinkLink( sink, action.getDueTo(), "mailto:" + action.getDueToEmail() );
                 }