jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-598) DateValue.equals() relies on Calendar.equals()
Date Tue, 24 Oct 2006 06:52:19 GMT
    [ http://issues.apache.org/jira/browse/JCR-598?page=comments#action_12444225 ] 
            
angela commented on JCR-598:
----------------------------

i just happen to find the section in the JSR170 specification dealing with equality conditions
of Value objects:

6.2.7.2 Equality Conditions
Two Value instances, v1 and v2, are considered equal if and only if
v1.getType() == v2.getType() and
v1.getString().equals(v2.getString()).
[...]

in [...] the specification states, that 'getString()'  is intended to be a normative definition
only. Still i'd argue, that evaluating equality of the Calendar objects, which also takes
that lenient flag and local specific settings such as first day of the week, is not correct.


> DateValue.equals() relies on Calendar.equals()
> ----------------------------------------------
>
>                 Key: JCR-598
>                 URL: http://issues.apache.org/jira/browse/JCR-598
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>            Reporter: angela
>
> JSR170 states regarding Date values:
> "The text format of dates must follow the following ISO 8601:2000-compliant format".
> While DateValue.valueOf(String) and DateValue.getString() both rely on the functionality
provided by the org.apache.jackrabbit.util.ISO8601, DateValue.equals() compares the equality
of the internal Calendar object (DateValue line 89). This may return false even if the Iso-format
of both values are equal.
> In other words: Creating a new DateValue using the ValueFactory from the String representation
of an existing DateValue will return an object, that is not equal to the original DateValue.
The reason for this is, that the String does not contain all infomation, that is used during
Calendar.equals.
> regards
> angela

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message