Hi,

Today suddenly the java.text.DateFormat.Test mauve test started failing.
This was a side effect of it setting a Calendar to non-lenience mode.
July 30, 2006 falls in the 6th week of the month and we didn't allow six
weeks in months. I added a a explicit Mauve test for this and fixed it
as follows:

2006-07-30  Mark Wielaard  <[EMAIL PROTECTED]>

    * java/util/GregorianCalendar.java (maximums): Months can have up to
    6 weeks.
    (nonLeniencyCheck): weeks is either 5 or 6.

Also checked into the release and generics branch.

I so suspect we need the check to be a little stricter than this. The
Mauve test also makes sure we handle months with exactly 4 weeks
(February 1998) correctly, but it doesn't check yet what happens if you
overflow the week number in such a month.

Cheers,

Mark
Index: java/util/GregorianCalendar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/GregorianCalendar.java,v
retrieving revision 1.44
diff -u -r1.44 GregorianCalendar.java
--- java/util/GregorianCalendar.java	25 Mar 2006 11:06:25 -0000	1.44
+++ java/util/GregorianCalendar.java	30 Jul 2006 20:39:51 -0000
@@ -445,7 +445,7 @@
 
     if (isSet[WEEK_OF_MONTH])
       {
-	int weeks = (month == 1 && leap == 0) ? 4 : 5;
+	int weeks = (month == 1 && leap == 0) ? 5 : 6;
 	if (fields[WEEK_OF_MONTH] < 1 || fields[WEEK_OF_MONTH] > weeks)
 	  throw new IllegalArgumentException("Illegal WEEK_OF_MONTH.");
       }
@@ -1164,7 +1164,7 @@
    */
   private static final int[] maximums = 
                                         {
-                                          AD, 5000000, 11, 53, 5, 31, 366,
+                                          AD, 5000000, 11, 53, 6, 31, 366,
                                           SATURDAY, 5, PM, 12, 23, 59, 59, 999,
                                           +(12 * 60 * 60 * 1000),
                                           (12 * 60 * 60 * 1000)

Reply via email to