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.