You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/05/23 02:46:15 UTC

svn commit: r176414 - /lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java /lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java

Author: gregor
Date: Sun May 22 17:46:14 2005
New Revision: 176414

URL: http://svn.apache.org/viewcvs?rev=176414&view=rev
Log:
Return an immutable copy of the checkout date to avoid exposing mutable internals.

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java
    lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java?rev=176414&r1=176413&r2=176414&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckInException.java Sun May 22 17:46:14 2005
@@ -26,7 +26,11 @@
  * Reserved check-in exception
  */
 public class FileReservedCheckInException extends Exception {
-    private String source = null;
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private String source = null;
     private Date date = null;
     private String username = null;
     private String typeString = null;
@@ -74,7 +78,7 @@
      * @return the date
      */
     public Date getDate() {
-        return this.date;
+        return new Date(this.date.getTime());
     }
 
     /**

Modified: lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java?rev=176414&r1=176413&r2=176414&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/rc/FileReservedCheckOutException.java Sun May 22 17:46:14 2005
@@ -26,7 +26,11 @@
  * Exception for already checked out files
  */
 public class FileReservedCheckOutException extends Exception {
-    private String source = null;
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private String source = null;
     private Date checkOutDate = null;
     private String checkOutUsername = null;
 
@@ -55,7 +59,15 @@
      * @return the date of the checkout
      */
     public Date getCheckOutDate() {
-        return this.checkOutDate;
+        return new Date(this.checkOutDate.getTime());
+    }
+
+    /**
+     * Get the source of the checkout.
+     * @return the source of the checkout
+     */
+    public String getSource() {
+        return this.source;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org