Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 81573 invoked from network); 26 Dec 2007 02:40:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Dec 2007 02:40:06 -0000 Received: (qmail 86449 invoked by uid 500); 26 Dec 2007 02:39:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 86423 invoked by uid 500); 26 Dec 2007 02:39:55 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 86414 invoked by uid 99); 26 Dec 2007 02:39:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Dec 2007 18:39:55 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 02:39:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1AFAB71422E for ; Tue, 25 Dec 2007 18:39:43 -0800 (PST) Message-ID: <27015842.1198636783107.JavaMail.jira@brutus> Date: Tue, 25 Dec 2007 18:39:43 -0800 (PST) From: "Tony Wu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-4907) [classlib][luni] Calendar.get(Calendar.WEEK_OF_MONTH) returns wrong value In-Reply-To: <24042547.1191896990585.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tony Wu reassigned HARMONY-4907: -------------------------------- Assignee: Tony Wu > [classlib][luni] Calendar.get(Calendar.WEEK_OF_MONTH) returns wrong value > ------------------------------------------------------------------------- > > Key: HARMONY-4907 > URL: https://issues.apache.org/jira/browse/HARMONY-4907 > Project: Harmony > Issue Type: Bug > Components: Classlib > Environment: harmony-jre-579330 > WindowXP > Reporter: Chen Shunfei > Assignee: Tony Wu > > Here is the testcase: > import java.util.Calendar; > import java.util.GregorianCalendar; > import junit.framework.TestCase; > public class Test extends TestCase { > public void testDayOfWeekInMonth() { > GregorianCalendar c = new GregorianCalendar(); > int minimalDaysInFirstWeek = 2; > int firstDayOfWeek = Calendar.SUNDAY; > c.setFirstDayOfWeek(firstDayOfWeek); > int month = Calendar.DECEMBER; > int year = 2007; > int day = 1; > c.set(year, month, day); > int dayOfWeek = c.get(Calendar.DAY_OF_WEEK); > int relativeDayOfWeek = (7 + dayOfWeek - firstDayOfWeek) % 7; > int relativeDayOfFirst = (relativeDayOfWeek - day + 1 + 35) % 7; > int weekOfFirst = ((7 - relativeDayOfFirst) >= minimalDaysInFirstWeek) ? 1 > : 0; > int weekOfMonth = (day + relativeDayOfFirst - 1) / 7 + weekOfFirst; > assertEquals(c.get(Calendar.WEEK_OF_MONTH), weekOfMonth); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.