harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Wu (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-4510) [classlib][luni][regression] GregorianCalendar.roll works incorrectly.
Date Sun, 22 Jul 2007 04:32:06 GMT

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

Tony Wu resolved HARMONY-4510.
------------------------------

    Resolution: Fixed

fixed at r558462, please check if it fixed as you expected. Thanks.

> [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.


Mime
View raw message