You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Pervov (JIRA)" <ji...@apache.org> on 2007/07/25 12:34:31 UTC
[jira] Commented: (HARMONY-4510) [classlib][luni][regression]
GregorianCalendar.roll works incorrectly.
[ https://issues.apache.org/jira/browse/HARMONY-4510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515251 ]
Pavel Pervov commented on HARMONY-4510:
---------------------------------------
Tony, the issue is now solved. Thank you.
> [classlib][luni][regression] GregorianCalendar.roll works incorrectly.
> ----------------------------------------------------------------------
>
> Key: HARMONY-4510
> URL: https://issues.apache.org/jira/browse/HARMONY-4510
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Pavel Pervov
> Assignee: Tony Wu
>
> Consider the following test case:
> ---------------------------------------
> import java.util.Date;
> import java.util.TimeZone;
> import java.util.GregorianCalendar;
> class jugc {
> public static void main(String[] args) {
> GregorianCalendar cal =
> new GregorianCalendar(TimeZone.getTimeZone("GMT"));
> Date d = new Date(99, 11, 31, 23, 59, 59);
> cal.setTime(d);
> cal.roll(GregorianCalendar.WEEK_OF_MONTH, true);
> cal.roll(GregorianCalendar.WEEK_OF_MONTH, false);
> if(f(cal.getTime()) == f(d)) {
> System.out.println("PASSED");
> } else {
> System.out.println("FAILED: expected (" +
> f(cal.getTime()) + ") got (" +
> f(d) + ")");
> }
>
> }
> static long f(Date di) { return di.getTime(); }
> }
> ---------------------------------------
> Result from RI is "PASSED".
> Result from Harmony is "FAILED: expected (946069199000) got (946673999000)"
> It looks like when rolling one week back it returns to December 24th, instead of December 31th.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.