Embedded in my question is, what is GSON used for at this stage? There
are potentially three serialization mechanisms in play (java.io,
Writable, GSON) and want to rationalize them. Is GSON still needed?
(Could well be) 'transient' doesn't have meaning for Writable, though
I take the point about annotation. But an annotation or comment could
be a better thing. 'transient' in a non-Serializable class looks at
first like a mistake.

On Wed, Sep 22, 2010 at 2:19 PM, Jeff Eastman
<[email protected]> wrote:
>  On 9/22/10 3:16 AM, Sean Owen wrote:
>>
>> Someone remind me about why we use 'transient' in the code?
>>
>> It has no meaning outside of java.io.Serializable, and customizing its
>> behavior. It's not seen in non-Serializable classes.
>> But, I remember someone commented at one point that it has meaning for
>> the GSON serialization mechanism. True?
>>
>> If so, is there a sense of which classes that affects? since I see it
>> in classes I don't think would ever be serialized like OnlineAuc.
>>
> Yes, Gson will not serialize transient state. It's also a reasonable way to
> indicate transient state that is not serialized by Writable. See
> AbstractCluster for an example.
>

Reply via email to