maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r374372 - in /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm: ChangeSet.java command/changelog/ChangeLogSet.java
Date Thu, 02 Feb 2006 12:27:32 GMT
Author: evenisse
Date: Thu Feb  2 04:27:28 2006
New Revision: 374372

URL: http://svn.apache.org/viewcvs?rev=374372&view=rev
Log:
Fix NPE

Modified:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogSet.java

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java?rev=374372&r1=374371&r2=374372&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java Thu Feb
 2 04:27:28 2006
@@ -333,14 +333,19 @@
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append( "\t<changelog-entry>\n" )
-            .append( "\t\t<date pattern=\"" + DATE_PATTERN + "\">" )
-            .append( getDateFormatted() )
-            .append( "</date>\n" )
-            .append( "\t\t<time pattern=\"" + TIME_PATTERN + "\">" )
-            .append( getTimeFormatted() )
-            .append( "</time>\n" )
-            .append( "\t\t<author><![CDATA[" )
+        buffer.append( "\t<changelog-entry>\n" );
+
+        if ( getDate() != null )
+        {
+            buffer.append( "\t\t<date pattern=\"" + DATE_PATTERN + "\">" )
+                .append( getDateFormatted() )
+                .append( "</date>\n" )
+                .append( "\t\t<time pattern=\"" + TIME_PATTERN + "\">" )
+                .append( getTimeFormatted() )
+                .append( "</time>\n" );
+        }
+
+        buffer.append( "\t\t<author><![CDATA[" )
             .append( author )
             .append( "]]></author>\n" );
 

Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogSet.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogSet.java?rev=374372&r1=374371&r2=374372&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogSet.java
(original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogSet.java
Thu Feb  2 04:27:28 2006
@@ -105,11 +105,24 @@
         String pattern = "yyyyMMdd HH:mm:ss z";
         SimpleDateFormat formatter = new SimpleDateFormat( pattern );
 
-        buffer.append( "<changeset datePattern=\"" + pattern + "\" start=\"" )
-            .append( formatter.format( startDate ) )
-            .append( "\" end=\"" )
-            .append( formatter.format( endDate ) )
-            .append( "\">\n" );
+        buffer.append( "<changeset datePattern=\"" )
+            .append( pattern )
+            .append( "\"" );
+
+        if ( startDate != null )
+        {
+            buffer.append( " start=\"" )
+                .append( formatter.format( startDate ) )
+                .append( "\"" );
+        }
+        if ( endDate != null )
+        {
+            buffer.append( " end=\"" )
+                .append( formatter.format( endDate ) )
+                .append( "\">" );
+        }
+
+        buffer.append( "\n" );
 
         //  Write out the entries
         for ( Iterator i = getChangeSets().iterator(); i.hasNext(); )



Mime
View raw message