PQ86149: ILLEGALARGUMENTEXCEPTION ON GREGORIANCALENDAR | |||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||
![]() APAR status Closed as program error. Error description IllegalArgumentException on GregorianCalendar calls. This is a known JVM defect, SOV69995. This APAR is opened to link the two together. See the SOV defect for further details.Local fix Problem summary **************************************************************** * USERS AFFECTED: All users of JDK version 1.2.2 and 1.3.1 . * **************************************************************** * PROBLEM DESCRIPTION: IllegalArgumentException on * * GregorianCalendar. * **************************************************************** * RECOMMENDATION: * **************************************************************** The problem detail is as follows: This problem occurs ONLY WHEN the following are all true - for the Calendar / GlegolianCalener object. - setLenient(false) is used, and - the date is set to December 31st of the leap year, and - "2" years are added to the year field. (any value not multiple of 4). With this condition, IllegalArgumentException will be thrown on subsequent get method execution. // testcase. This does not work import java.util.Calendar; import java.util.GregorianCalendar; public class LeapTest { public static void main(String _args){ GregorianCalendar c = new GregorianCalendar(); c.setLenient(false); c.set(2004, 11, 31); // this means Dec 31 2004 System.out.println(c.getTime()); c.add(Calendar.YEAR, 2); System.out.println(c.get(Calendar.YEAR) + "/" + c.get(Calendar.MONTH)+ "/" + c.get(Calendar.DATE)); } } Result: >java LeapTest Fri Dec 31 13:28:52 JST 2004 Exception in thread "main" java.lang.IllegalArgumentException at java.util.GregorianCalendar.computeTime (GregorianCalendar.java:1373) at java.util.Calendar.updateTime(Calendar.java:1523) at java.util.Calendar.complete(Calendar.java:1063) at java.util.Calendar.get(Calendar.java:913) at LeapTest.main(LeapTest.java:10)Problem conclusion This has been fixed in JDK defect SOV, 69995.Temporary fix Comments
APAR is sysrouted FROM one or more of the following: APAR is sysrouted TO one or more of the following: Modules/Macros
SRLS
|
Document Information |
Product categories: Software > Application Servers >
Distributed Application & Web Servers > WebSphere Application
Server > General
Operating system(s):
Software version: 400
Software edition:
Reference #: PQ86149
IBM Group: Software Group
Modified date: Mar 17, 2004
(C) Copyright IBM Corporation 2000, 2006. All Rights Reserved.