IBM Support

IZ33125: TIMESTAMP WILL THROW CLASSCASTEXCEPTION WHEN PASSING A DATE TO ITS COMPARETO METHOD

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: java.sql.Timestamp can't work normally  when
    invoking compareTo(Date) method.  The compare will throw a
    ClassCastException when the parameter is a instance of Date but
    Timestamp.
    .
    Stack Trace: java.lang.ClassCastException: java.util.Date
    incompatible with java.sql.Timestamp
     at java.sql.Timestamp.compareTo(Unknown Source)
    .
    

Local fix

Problem summary

  • compareTo(Date) method will cast the parameter of Date to
    Timestamp when comparing these two instances. If the parameter
    is a instance of Date rather than a Timestamp, it will throw the
    ClassCastException.
    

Problem conclusion

  • This defect will be fixed in:
    6.0.0 SR3
    .
    When comparing a Timestamp with Date, cast the instance type to
    Timestamp if and only if it is a instance of Timestamp. If it is
    a Date, compare diretly by their time value without casting.
    .
    To obtain the fix:
    Install build 20080925 or later
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ33125

  • Reported component name

    JAVA CLASS LIBS

  • Reported component ID

    620700130

  • Reported release

    600

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-09-24

  • Closed date

    2008-09-26

  • Last modified date

    2008-09-26

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    JAVA CLASS LIBS

  • Fixed component ID

    620700130

Applicable component levels

  • R600 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCVQ3Y","label":"Java Class Libraries"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
26 September 2008