JDK-4639407 : GregorianCalendar doesn't work in non-lenient due to timezone bounds checking
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.0,5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_2.6,windows_98
  • CPU: generic,x86,sparc
  • Submitted: 2002-02-19
  • Updated: 2003-11-05
  • Resolved: 2003-11-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_11Fixed
Related Reports
Duplicate :  
Duplicate :  
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
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b28 tiger-beta
14-06-2004

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
01-03-2002

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
19-02-2002