You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2006/11/24 20:43:36 UTC

svn commit: r478960 - /jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/value/DateValue.java

Author: jukka
Date: Fri Nov 24 11:43:36 2006
New Revision: 478960

URL: http://svn.apache.org/viewvc?view=rev&rev=478960
Log:
1.1: Merged revision 467674 (JCR-598)

Modified:
    jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/value/DateValue.java

Modified: jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/value/DateValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/value/DateValue.java?view=diff&rev=478960&r1=478959&r2=478960
==============================================================================
--- jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/value/DateValue.java (original)
+++ jackrabbit/branches/1.1/jackrabbit/src/main/java/org/apache/jackrabbit/value/DateValue.java Fri Nov 24 11:43:36 2006
@@ -72,6 +72,15 @@
      * The result is <code>true</code> if and only if the argument is not
      * <code>null</code> and is a <code>DateValue</code> object that
      * represents the same value as this object.
+     * <p>
+     * The value comparison is performed using the ISO 8601 string
+     * representation of the dates, since the native Calendar.equals()
+     * method may produce false negatives (see JSR-598).
+     * <p>
+     * Note that the comparison still returns false when comparing the
+     * same time in different time zones, but that seems to be the intent
+     * of JSR 170. Compare the Value.getDate().getTime() values if you need
+     * an exact time comparison in UTC. 
      *
      * @param obj the reference object with which to compare.
      * @return <code>true</code> if this object is the same as the obj
@@ -86,7 +95,7 @@
             if (date == other.date) {
                 return true;
             } else if (date != null && other.date != null) {
-                return date.equals(other.date);
+                return ISO8601.format(date).equals(ISO8601.format(other.date));
             }
         }
         return false;