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/20 16:36:06 UTC

[jira] Created: (HARMONY-4510) [classlib][luni][regression] GregorianCalendar.roll works incorrectly.

[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


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.


[jira] Resolved: (HARMONY-4510) [classlib][luni][regression] GregorianCalendar.roll works incorrectly.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Assigned: (HARMONY-4510) [classlib][luni][regression] GregorianCalendar.roll works incorrectly.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu reassigned HARMONY-4510:
--------------------------------

    Assignee: Tony Wu

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


[jira] Commented: (HARMONY-4510) [classlib][luni][regression] GregorianCalendar.roll works incorrectly.

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ 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.