harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Khaschansky" <oleg.v.khaschan...@gmail.com>
Subject Re: [classlib][luni] Serialization problem with EnumSet
Date Mon, 14 Aug 2006 10:19:56 GMT
It looks like EnumSet.SerializationProxy is the class that is
serialized instead of EnumSet, since it overrides readResolve method
and contains the information, essential for re-creation of EnumSet.
Probably, the scheme looks like this:
1) EnumSet overrides writeReplace which returns appropriate
EnumSet.SerializationProxy object, which is serialized.
2) When EnumSet.SerializationProxy is deserialized, readResolve method
is called to replace deserialized instance of
EnumSet.SerializationProxy with appropriate EnumSet object. This
method constructs EnumSet object with one of its factory methods
(noneOf suits for this, probably) and initializes it properly.

See API specification for Serializable interface for the description
of readResolve/writeReplace.

I am not an expert in serialization, so I am not sure if we need to
copy this behavior to be compatible with RI or it is possible just to
use SerialVersionUID and serialized form of EnumSet.SerializationProxy
for our EnumSet.

On 8/14/06, Spark Shen <smallsmallorgan@gmail.com> wrote:
> Hi All:
> After reading the serialized form of EnumSet, I found an inner class
>
> java.util.EnumSet.SerializationProxy.
>
> This class does not have any extra explaination. Does any one has any
> suggestion on how to deal with it?
>
> Best regards
>
> --
> Spark Shen
> China Software Development Lab, IBM
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message