United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4639407 GregorianCalendar doesn't work in non-lenient due to timezone bounds checking
JDK-4639407 : GregorianCalendar doesn't work in non-lenient due to timezone bounds checking

Details
Type:
Bug
Submit Date:
2002-02-19
Status:
Resolved
Updated Date:
2003-11-05
Project Name:
JDK
Resolved Date:
2003-11-05
Component:
core-libs
OS:
solaris_2.6,generic,windows_98
Sub-Component:
java.util:i18n
CPU:
x86,sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0,5.0
Fixed Versions:
5.0 (b28)

Related Reports
Backport:
Duplicate:
Duplicate:

Sub Tasks

Description
GregorianCalendar doesn't work in non-lenient mode due to bounds checking.

Time zones affected are:

Pacific/Chatham		12:45
(NZ_CHAT)
Pacific/Tongatapu	13:00
Pacific/Enderbury	13:00
Pacific/Kiritimati	14:00

If historical changes are considered, the following are also affected by GMT offset or 2 hour daylight saving:

Asia/Anadyr		13:00	Russia	ANA%sT	1982 Apr  1 0:00s

America/Dawson
America/Whitehorse
America/Cambridge_Bay
America/Inuvik 
America/Yellowknife
America/Rankin_Inlet
America/Iqaluit 
America/Pangnirtung
America/Goose_Bay
America/St_Johns 
Atlantic/Azores
Atlantic/Madeira
Europe/Belfast
Europe/Lisbon 
Europe/London
Europe/Paris 
Europe/Berlin
Europe/Gibraltar
Europe/Madrid
Europe/Monaco
Asia/Jerusalem
Europe/Moscow


In GregorianCalendar, 

     *                            Greatest       Least 
     * Field name        Minimum   Minimum     Maximum     Maximum
     * ----------        -------   -------     -------     -------
     * ZONE_OFFSET           -12*      -12*         12*         12*
     * DST_OFFSET              0         0           1*          1*


should be:

     * ZONE_OFFSET           -13*      -13*         14*         14*
     * DST_OFFSET              0         0           2*          2*

                                    

Comments
SUGGESTED FIX

*** /tmp/geta20721	Tue Feb 19 11:20:03 2002
--- GregorianCalendar.java	Tue Feb 19 11:14:55 2002
***************
*** 279,297 ****
       * MINUTE                  0         0          59          59
       * SECOND                  0         0          59          59
       * MILLISECOND             0         0         999         999
!      * ZONE_OFFSET           -12*      -12*         12*         12*
!      * DST_OFFSET              0         0           1*          1*
       * </pre>
       * (*) In units of one-hour
       */
      private static final int MIN_VALUES[] = {
!         0,1,0,1,0,1,1,1,-1,0,0,0,0,0,0,-12*ONE_HOUR,0
      };
      private static final int LEAST_MAX_VALUES[] = {
!         1,292269054,11,52,4,28,365,7,4,1,11,23,59,59,999,12*ONE_HOUR,1*ONE_HOUR
      };
      private static final int MAX_VALUES[] = {
!         1,292278994,11,53,6,31,366,7,6,1,11,23,59,59,999,12*ONE_HOUR,1*ONE_HOUR
      };
  
  /////////////////////
--- 279,297 ----
       * MINUTE                  0         0          59          59
       * SECOND                  0         0          59          59
       * MILLISECOND             0         0         999         999
!      * ZONE_OFFSET           -13*      -13*         14*         14*
!      * DST_OFFSET              0         0           2*          2*
       * </pre>
       * (*) In units of one-hour
       */
      private static final int MIN_VALUES[] = {
!         0,1,0,1,0,1,1,1,-1,0,0,0,0,0,0,-13*ONE_HOUR,0
      };
      private static final int LEAST_MAX_VALUES[] = {
!         1,292269054,11,52,4,28,365,7,4,1,11,23,59,59,999,14*ONE_HOUR,2*ONE_HOUR
      };
      private static final int MAX_VALUES[] = {
!         1,292278994,11,53,6,31,366,7,6,1,11,23,59,59,999,14*ONE_HOUR,2*ONE_HOUR
      };
  
  /////////////////////

###@###.### 2002-02-19
                                     
2002-02-19
EVALUATION

Should be fixed in Hopper.
###@###.### 2002-02-19


Unfortunately, this fix breaks a JCK test. The fix will go to Tiger.
###@###.### 2002-03-01


The JCK problem has been filed as 4937099.
###@###.### 2003-10-14
                                     
2002-03-01
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger
tiger-beta

FIXED IN:
tiger-beta

INTEGRATED IN:
tiger-b28
tiger-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together