How does XStream deal with newer versions of classes?
• If a new field is added to the class, deserializing an old version will leave the field uninitialized. • If a field is removed from the class, deserializing an old version that contains the field will cause an exception. Leaving the field in place but declaring it as transient will avoid the exception, but XStream will not try to deserialize it. • If a class is renamed, aliases can be used to create an abstraction between the name used in XML and the real class name. • If a field is renamed, this should be treated as adding a field and removing a field. For more advanced class migrations, you may • have to do custom pre-processing of the XML before sending it to XStream (for example, with XSLT or DOM manipulations) • declare new fields as transient • implement your own converter, that can handle the situation • add a readResolve() method to your class, that initializes the object accordingly • implement a custom mapper to ignore unknown fields automatically (see acceptance test Custo