You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by py...@apache.org on 2006/08/02 08:09:23 UTC

svn commit: r427909 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/org/apache/harmony/luni/internal/locale/ test/java/tests/api/java/util/

Author: pyang
Date: Tue Aug  1 23:09:22 2006
New Revision: 427909

URL: http://svn.apache.org/viewvc?rev=427909&view=rev
Log:
Fix for HARMONY-1037 ([classlib][luni] java.util.GregorianCalendar.getMinimalDaysInFirstWeek() method does not return correct value)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_en_GB.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_fr.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_en_GB.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_en_GB.java?rev=427909&r1=427908&r2=427909&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_en_GB.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_en_GB.java Tue Aug  1 23:09:22 2006
@@ -1,4 +1,4 @@
-/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 protected Object[][] getContents() {
 	Object[][] contents = {
 		{"First_Day",new java.lang.Integer(2),},
+        {"Minimal_Days",new java.lang.Integer(4),}, //$NON-NLS-1$
 		{"timezones",new String[][]{new String[]{"Europe/London","Greenwich Mean Time","GMT","British Summer Time","BST",},
 new String[]{"PST","Pacific Standard Time","PST","Pacific Daylight Time","PDT",},
 new String[]{"America/Los_Angeles","Pacific Standard Time","PST","Pacific Daylight Time","PDT",},

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_fr.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_fr.java?rev=427909&r1=427908&r2=427909&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_fr.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/locale/Locale_fr.java Tue Aug  1 23:09:22 2006
@@ -1,4 +1,4 @@
-/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 protected Object[][] getContents() {
 	Object[][] contents = {
 		{"First_Day",new java.lang.Integer(2),},
+        {"Minimal_Days",new java.lang.Integer(4),}, //$NON-NLS-1$
 		{"eras",new String[]{"BC","ap. J.-C.",},
 },
 		{"months",new String[]{"janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre","",},

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java?rev=427909&r1=427908&r2=427909&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java Tue Aug  1 23:09:22 2006
@@ -564,6 +564,22 @@
         gCalend.set(Calendar.MILLISECOND, 0);//changes nothing
         assertEquals("After", dayOfMonth, gCalend.get(Calendar.DAY_OF_MONTH));
     }
+    
+    /**
+     * @tests java.util.GregorianCalendar#getMinimalDaysInFirstWeek()
+     */
+    public void test_getMinimalDaysInFirstWeek() {
+        // Regression for Harmony-1037
+        GregorianCalendar g = new GregorianCalendar(TimeZone
+                .getTimeZone("Europe/London"), new Locale("en", "GB"));
+        int minimalDaysInFirstWeek = g.getMinimalDaysInFirstWeek();
+        assertEquals(4, minimalDaysInFirstWeek);
+
+        g = new GregorianCalendar(TimeZone.getTimeZone("Europe/London"),
+                new Locale("fr"));
+        minimalDaysInFirstWeek = g.getMinimalDaysInFirstWeek();
+        assertEquals(4, minimalDaysInFirstWeek);
+    }
 
 	/**
 	 * Sets up the fixture, for example, open a network connection. This method