harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-947) GregorianCalendar.getLeastMaximim(int) returns values that differ from RI
Date Fri, 29 Sep 2006 03:14:51 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-947?page=all ]

Paulex Yang resolved HARMONY-947.
---------------------------------

    Resolution: Fixed

Spark, thank you for looking at this. 

Anton, patch applied at revision r451100, thanks a lot for this enhancement, please verify
that the problem is fully fixed as you expected. 


> GregorianCalendar.getLeastMaximim(int) returns values that differ from RI
> -------------------------------------------------------------------------
>
>                 Key: HARMONY-947
>                 URL: http://issues.apache.org/jira/browse/HARMONY-947
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows XP Professional
>            Reporter: Anton Luht
>         Assigned To: Paulex Yang
>            Priority: Minor
>         Attachments: patch.txt
>
>
> Harmony classlib + DRLVM 424264
> Values that are returned by Calendar.getLeastMaximum(int) differ from RI. The following
code shows it:
> import java.util.*;
> public class Test {
>      public static void main(String args[]) {
>         String localVariable0 = "PST";
>         TimeZone localTimeZone = TimeZone.getTimeZone(localVariable0);
>         Calendar localCalendar = Calendar.getInstance(localTimeZone);
>         
>         int[] max = { 1, 292269054, 11, 50, 3, 28, 355, 7, 3, 1, 11, 23, 59,
> 				59, 999, 50400000, 1200000 };
>         for (int i = 0; i < max.length; i++) {
>           if (localCalendar.getLeastMaximum(i) != max[i]) {
>             System.err.println("wrong value at " + i + ": expected " + max[i] + ", got
" + localCalendar.getLeastMaximum(i));
>           }
>         }
>     }
> }
> On RI it prints nothing, on Harmony it prints:
> wrong value at 3: expected 52, got 50
> wrong value at 4: expected 3, got 4
> wrong value at 6: expected 355, got 365
> wrong value at 8: expected 3, got 4
> wrong value at 15: expected 50400000, got 43200000
> wrong value at 16: expected 1200000, got 3600000
> I do not understand quite well how can 50-week year happen, maybe it was the year when
dates shifted, but anyway - for compatibility with RI it's better for that function to return
same values.
> Please see the patch to junit test and classlib code attached

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message