You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2016/06/22 13:47:57 UTC

[jira] [Closed] (SLING-5612) AssertCalendar needlessly compares timezone offsets

     [ https://issues.apache.org/jira/browse/SLING-5612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-5612.
-----------------------------------

> AssertCalendar needlessly compares timezone offsets
> ---------------------------------------------------
>
>                 Key: SLING-5612
>                 URL: https://issues.apache.org/jira/browse/SLING-5612
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.7.4
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>             Fix For: JCR Resource 2.8.0
>
>
> The {{AssertCalendar}} class in the test code compares Calendar objects like this:
> {code}
> assertEquals(expected.getTime(), actual.getTime());
> assertEquals(expected.getTimeZone().getRawOffset(), actual.getTimeZone().getRawOffset());
> {code}
> Comparing the timezones is not needed IMO, Calendar internally stores stores the time in msec since the epoch, so comparing getTimeInMillis() is sufficient to declare two Calendars as pointing to the same time. For our tests, it's fine for the timezones to be different.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)