You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2013/10/23 16:41:42 UTC
[jira] [Commented] (OAK-1111) Node#setProperty(String, Calendar)
doesn't take time zone in account
[ https://issues.apache.org/jira/browse/OAK-1111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13802906#comment-13802906 ]
Michael Dürig commented on OAK-1111:
------------------------------------
I think the test expectations are to strict: the returned calendar values represent the same date, only the time zone differ. According to the JCR spec: "If V1 and V2 are values of type DATE then the repository must use the semantics of java.lang.Calendar.compareTo, as described in §3.6.5.1 CompareTo Semantics."
Thus the assertion in the test case should read
{code}
assertEquals(0, cal.compareTo(root.getProperty("start").getDate()));
{code}
> Node#setProperty(String, Calendar) doesn't take time zone in account
> --------------------------------------------------------------------
>
> Key: OAK-1111
> URL: https://issues.apache.org/jira/browse/OAK-1111
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core, jcr
> Reporter: Antonio Sanso
> Attachments: OAK-1111-test.txt
>
>
> Node#setProperty(String, Calendar) doesn't take time zone in account.
> It looks the Calendar value is straightly stored as a long without take in consideration the time zone,
> Unit test to follow
--
This message was sent by Atlassian JIRA
(v6.1#6144)