Hi Thomas,

Thomas Mauch wrote:

> Can you tell me what is the reason behind the decision that volatile
> fields are serialized by XStream?
> I know that there is @XStreamOmitField or I could write a custom
> converter, but in fact the information that I do not want  a field
> serialized, is already available by using a volatile.

What has a volatile declaration to do with persistence? It is a hint for the 
compiler to take extra care accessing the value of the variable, but when 
you persist an object, a volatile member has a value for that specific 
moment and therefore it is serialized. Otherwise declare those fields 
additionally as transient, that's what it is there fore.

- Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to