Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 99745 invoked from network); 2 Oct 2006 11:29:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Oct 2006 11:29:46 -0000 Received: (qmail 90551 invoked by uid 500); 2 Oct 2006 11:29:46 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 90451 invoked by uid 500); 2 Oct 2006 11:29:46 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 90440 invoked by uid 99); 2 Oct 2006 11:29:46 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 04:29:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:40408] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 49/D6-16499-428F0254 for ; Mon, 02 Oct 2006 04:29:40 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4211571430D for ; Mon, 2 Oct 2006 04:29:21 -0700 (PDT) Message-ID: <5994494.1159788561268.JavaMail.root@brutus> Date: Mon, 2 Oct 2006 04:29:21 -0700 (PDT) From: "Anton Luht (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-947) GregorianCalendar.getLeastMaximim(int) returns values that differ from RI In-Reply-To: <12648479.1153482733931.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-947?page=comments#action_12439110 ] Anton Luht commented on HARMONY-947: ------------------------------------ Spark, thank you for your insightful comments. Paulex, I verify that the problem doesn't exist in revision 451969 > 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