Forget my stupid question. I was working a lot with threading lately and so I just messed up the keywords volatile and serialized in my code... And I was really wondering why a great tool like XStream did not work as expected.
Sorry, Thomas -------- Original-Nachricht -------- > Datum: Wed, 30 May 2012 11:36:11 +0200 > Von: "Jörg Schaible" <[email protected]> > An: [email protected] > Betreff: [xstream-user] Re: Why are volatile fields serialized? > > 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 > > -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
