Thanks Rickard, I am not upgrading to the latest version exactly for that 
reason... we already had numerous emails (on the list) regarding that issue. I 
am glad it is finally fixed and I will not need to maintain my patched one 
anymore.

Philippe

Le 26 nov. 2009 à 12:09, Rickard Öberg a écrit :

> Hi,
> 
> I've found an issue with ValueComposite serialization. Basically, if you have 
> a base ValueComposite type Foo and then subclass it with CustomFoo, then if a 
> field references the base type Foo then that is what is going to be used for 
> serialization/deserialization, even if the actual value is a CustomFoo. 
> Basically the Value will be downgraded to Foo, no matter what.
> 
> The solution I'm going with now is to check during serialization whether the 
> value actually is Foo, and if not, then I add a JSON field "_type" which has 
> the classname of the value. During deserialization I check for "_type", and 
> if available I use that.
> 
> I've added checks to ValueSerializationTest for this, and it seems to work 
> ok. Does this sound like an ok fix to everyone? The normal case is still not 
> to include any type info during deserialization. It's only if the expected 
> type doesn't match the actual one that the _type will be included.
> 
> /Rickard
> 
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to