IBM Support

IZ33124: SERILIZE HASHMAP WILL THROW CLASSCASTEXCEPTION WHEN EXTENDS ITS INNER CLASS MAP.ENTRY

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: After extending HashMap's inner class of
    Map.Entry, serialize the HashMap will throw a
    ClassCastException.
    .
    Stack Trace: java.lang.ClassCastException:
    luni.TestSerialization$TestEntrySetEntry incompatible with
    java.util.HashMap$Entry
     at java.util.HashMap.writeObject(HashMap.java:845)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor
    Impl.java:45)
     at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod
    AccessorImpl.java:37)
     at java.lang.reflect.Method.invoke(Method.java:599)
     at
    java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.ja
    va:956)
     at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.ja
    va:1472)
     at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStrea
    m.java:1403)
     at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
    1161)
     at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:3
    37)
     at luni.TestSerialization.main(TestSerialization.java:98)
    Exception in thread "main" java.lang.RuntimeException:
    java.lang.ClassCastException:
    luni.TestSerialization$TestEntrySetEntry incompatible with
    java.util.HashMap$Entry
     at luni.TestSerialization.main(TestSerialization.java:103)
    Caused by: java.lang.ClassCastException:
    luni.TestSerialization$TestEntrySetEntry incompatible with
    java.util.HashMap$Entry
     at java.util.HashMap.writeObject(HashMap.java:845)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor
    Impl.java:45)
     at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod
    AccessorImpl.java:37)
     at java.lang.reflect.Method.invoke(Method.java:599)
     at
    java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.ja
    va:956)
     at
    java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.ja
    va:1472)
     at
    java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStrea
    m.java:1403)
     at
    java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
    1161)
     at
    java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:3
    37)
     at luni.TestSerialization.main(TestSerialization.java:98)
    .
    

Local fix

Problem summary

  • Internal method writeObject will cast the Map.Entry unnecessary.
    

Problem conclusion

  • This defect will be fixed in:
    6.0.0 SR3
    .
    Remove the incorrect type casting in writeObject of HashMap
    .
    To obtain the fix:
    Install build 20080925 or later
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ33124

  • 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