Index: Cookie.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v
retrieving revision 1.10
diff -c -r1.10 Cookie.java
*** Cookie.java	5 Jan 2002 11:15:59 -0000	1.10
--- Cookie.java	7 Feb 2002 06:51:51 -0000
***************
*** 80,85 ****
--- 80,86 ----
   * @author <a href="mailto:jericho@thinkfree.com">Park, Sung-Gu</a>
   * @author <a href="mailto:dsale@us.britannica.com">Doug Sale</a>
   * @author Rod Waldhoff
+  * @author Sean C. Sullivan
   * @version $Revision: 1.10 $ $Date: 2002/01/05 11:15:59 $
   */
  
***************
*** 154,164 ****
  
      /**
       * Returns my expiration {@link Date}, or <tt>null</tt>
!      * if none exists.
       * @return my expiration {@link Date}, or <tt>null</tt>.
       */
      public Date getExpiryDate() {
!         return _expiryDate;
      }
  
      /**
--- 155,173 ----
  
      /**
       * Returns my expiration {@link Date}, or <tt>null</tt>
!      * if none exists.  
       * @return my expiration {@link Date}, or <tt>null</tt>.
       */
      public Date getExpiryDate() {
! 	Date result = null;
! 	if (_expiryDate != null)
! 	{
! 		// Since instances of java.util.Date are mutable, we must
! 		// perform a defensive copy. We don't want the caller
! 		// to be able to modify our Date object's state.
! 		result = new java.util.Date(_expiryDate.getTime());
! 	}
!         return result;
      }
  
      /**
***************
*** 177,183 ****
       * @param expiryDate the {@link Date} after which this cookie is no longer valid.
       */
      public void setExpiryDate (Date expiryDate) {
!         _expiryDate = expiryDate;
      }
  
  
--- 186,202 ----
       * @param expiryDate the {@link Date} after which this cookie is no longer valid.
       */
      public void setExpiryDate (Date expiryDate) {
! 	if (expiryDate == null)
! 	{
!         	_expiryDate = null;
! 	}
! 	else
! 	{
! 		// Since instances of java.util.Date are mutable, we must
! 		// perform a defensive copy. We don't want the caller
! 		// to be able to modify our Date object's state.
! 	        _expiryDate = new java.util.Date(expiryDate.getTime());
! 	}
      }
  
  

