harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Mishura (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-233) private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey class
Date Fri, 24 Mar 2006 09:58:28 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-233?page=all ]

Stepan Mishura updated HARMONY-233:

    Attachment: fixKerberosKey_SecretKeySpec.txt

I've serialized object of SecretKeySpec class on Harmony and tried to deserialized it on RI.
Got the following exception:
java.io.InvalidClassException: javax.crypto.spec.SecretKeySpec; local class incompatible:
stream classdesc serialVersionUID = -6458860205326416073, local class serialVersionUID = 6577238317307289933

I looked at serial spec. and found that serialVersionUID must be explicitly declared otherwise
it is calculated by the serialization runtime. A serialVersionUID field is not inherited!
So inheriting it from interface javax.crypto.SecretKey doesn't make Harmony implementation
compatible. And we have to declare it explicitly. This was discussed on harmony-dev mailing
list [1] so I assume it is OK to add it to SecretKeySpec class.

The patch includes fix for KerberosKey and SecretKeySpec. Feel free to change comments to
SecretKeySpec.serialVersionUID field.

[1] http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200601.mbox/%3c906dd82e0601190059x3162c6c6u533928579c226572@mail.gmail.com%3e

> private serialVersionID field should be set in javax.security.auth.kerberos.KerberosKey
> ---------------------------------------------------------------------------------------------
>          Key: HARMONY-233
>          URL: http://issues.apache.org/jira/browse/HARMONY-233
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: fixHarmony233.txt, fixKerberosKey_SecretKeySpec.txt
> According to J2SE 1.4  specifications javax.security.auth.kerberos.KerberosKey class
> public serialVersionUID field (it implements SecretKey interface that inherited this
field from java.security.Key interface where the field is public).
> But according J2SE 1.5 specification this field in Key interface is not public, so class
KerberosKey should have private serialVersionID field.
> The same problem is for javax.cripto.spec.SecretKeySpec class.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message