harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-947) GregorianCalendar.getLeastMaximim(int) returns values that differ from RI
Date Fri, 21 Jul 2006 11:52:13 GMT
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
            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