Re: [Simple-support] Once again some test cases: Replace
Brought to you by:
niallg
|
From: Simon B. <sim...@if...> - 2012-07-22 10:19:31
|
Hi Niall, Sorry, there was a typo in Test2. Of course it should try to deserialize an instance of Test2. However the problem is not the deserialization (though the eror happens there). The problem is that during the serialization the replace method is not called if an object is serialized as part of an ElementList. With respect to Test1: Yes this is definitely a bug. The point is that actually never an instance of Test1$Test1B is ever serialized but is always replaced by an instance of Test1. And for the deserialization, an instance of Test1$Test1B is never deserialized, but only instances of Test1 which are resolved to instances of Test1$Test1B. The exception would be kind of correct if it did occur during the deserialization of an instance of Test1$Test1B. However it occurs during the serialization. Please compare the constructors of Test1$Test1A and of Test1$Test1B. The main difference is, that Test$Test1A has no default constructor (Note that the constructor of Test1$Test1A is not annotated and just has dummy argument to achieve this). However serialization and deserialization are fine for Test1$Test1A but not for Test1$Test1B. Best Regards Simon -----Ursprüngliche Nachricht----- Von: Niall Gallagher [mailto:gal...@ya...] Gesendet: Sonntag, 22. Juli 2012 10:49 An: sim...@li...; Simon Brodt Betreff: Re: [Simple-support] Once again some test cases: Replace Hi Simon, I am not sure Test1 is actually an error, for instance how do you deserialize the final string if there is no method or constructor to accept it, I think whats needed here is required=false, or at least annotate the constructor argument so it can be accepted then just ignore it. With regards to Test2 I am not sure whats being tested. You serialize Test2 be deserialize Test1 however in no place is @Replace or @Resolve used to switch to Test1 anywhere. Is this case correct? If you think there is a real issue here that I am just not getting let me know, I appreciate the feedback. Thanks, Niall --- On Sat, 21/7/12, Simon Brodt <sim...@if...> wrote: > From: Simon Brodt <sim...@if...> > Subject: [Simple-support] Once again some test cases: Replace > To: sim...@li... > Received: Saturday, 21 July, 2012, 10:51 PM > Dear Niall, > > It seems like I discovered some problem with the Replace > annotation. Maybe > you could have a look on it. > > Best Regards > > Simon > > -----Inline Attachment Follows----- > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's > security and > threat landscape has changed and how IT managers can > respond. Discussions > will include endpoint security, mobile security and the > latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > -----Inline Attachment Follows----- > > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |