views:

21

answers:

1

I have

class A {
   @xstreamalias("obj1");
   Object obj1;
   @xstreamalias("obj2");
   Object obj2;
}

and I want to change to 
class AbstractA {
   @xstreamalias("obj1");
   Object obj1;
}

class A extends AbstractA{
   @xstreamalias("obj2");
   Object obj2;
}


without loosing the contents of obj1.

currently I have no trouble reading the old xml except I loos the content of obj1. is this somehow supported in xstream? I mean abstraction is a common thing in model changes.

A: 

XStream does not really care about whether A is a sub-class or not as long as the XML still fits.

My suggestion: Compare the result of serialization of the new class A with the old one (they should be identical). If not, then this is the source of your problem.

Christopher Oezbek