PQ86149: ILLEGALARGUMENTEXCEPTION ON GREGORIANCALENDAR

 A fix is available

***SUPERCEDED*** 1.3.1 Java SDK, Java Tech Edition for WebSphere v5



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 information
APAR number PQ86149
Reported component name WEBSPHERE AE AI
Reported component ID 5630A2200
Reported release 400
Status CLOSED PER
PE NoPE
HIPER NoHIPER
Submitted date 2004-03-16
Closed date 2004-03-17
Last modified date 2004-03-17

APAR is sysrouted FROM one or more of the following:

APAR is sysrouted TO one or more of the following:

Modules/Macros
JDK          

SRLS

Fix information

Applicable component levels
R400 PSY    UP


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