Author: kevj
Date: Tue Mar  7 19:56:59 2006
New Revision: 384111

URL: http://svn.apache.org/viewcvs?rev=384111&view=rev
Log:
Java API change to Date.after causes bug #30471, added check and comment

Modified:
    
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java?rev=384111&r1=384110&r2=384111&view=diff
==============================================================================
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java 
(original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java 
Tue Mar  7 19:56:59 2006
@@ -326,7 +326,24 @@
         for (int i = 0; i < entrySet.length; i++) {
             final CVSEntry cvsEntry = entrySet[i];
             final Date date = cvsEntry.getDate();
-
+            
+            //bug#30471
+            //this is caused by Date.after throwing a NullPointerException
+            //for some reason there's no date set in the CVSEntry
+            //Java 1.3.1 API
+            
//http://java.sun.com/j2se/1.3/docs/api/java/util/Date.html#after(java.util.Date)
+            //doesn't throw NullPointerException
+            //Java 1.4.2 + 1.5 API
+            
//http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html#after(java.util.Date)
+            //according to the docs it doesn't throw, according to the bug 
report it does
+            
//http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#after(java.util.Date)
+            //according to the docs it does throw
+            
+            //for now skip entries which are missing a date
+            if (null == date) {
+                continue;
+            }
+            
             if (null != startDate && startDate.after(date)) {
                 //Skip dates that are too early
                 continue;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to