You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by sg...@apache.org on 2009/06/11 23:13:55 UTC

svn commit: r783910 - /commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java

Author: sgoeschl
Date: Thu Jun 11 21:13:54 2009
New Revision: 783910

URL: http://svn.apache.org/viewvc?rev=783910&view=rev
Log:
Make findbugs happy with the existing code - the internal mail sent date was exposed by the API

Modified:
    commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java

Modified: commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java?rev=783910&r1=783909&r2=783910&view=diff
==============================================================================
--- commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java (original)
+++ commons/proper/email/trunk/src/java/org/apache/commons/mail/Email.java Thu Jun 11 21:13:54 2009
@@ -1276,7 +1276,11 @@
      */
     public void setSentDate(Date date)
     {
-        this.sentDate = date;
+        if (date != null)
+        {
+            // create a seperate instance to keep findbugs happy
+            this.sentDate = new Date(date.getTime());
+        }
     }
 
     /**
@@ -1291,7 +1295,7 @@
         {
             return new Date();
         }
-        return this.sentDate;
+        return new Date(this.sentDate.getTime());
     }
 
     /**