History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XSTR-318
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Assignee: Unassigned
Reporter: Dimitry Fayerman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XStream

readResolve called twise before and after reading

Created: 26/May/06 09:06 PM   Updated: 07/Aug/06 09:03 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2

Issue Links:
dependent
 

JDK version and platform: 1.4.2_10 for Windows


 Description  « Hide
If object implements readResolve() method it is called twise: once before the attributes are assigned and once after.
This is different from Sun Serialization specification. The readResolve should be called only once after object is fully constructed and all values assigned.

Here is the quote from Sun Serialization specification:
"The readResolve method is not invoked on the object until the object is fully
constructed"



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Joerg Schaible - 06/Jul/06 02:27 PM
Hi Dimitry,

we have a unit test, that ensures, that this normally does not happen: http://fisheye.codehaus.org/browse/xstream/trunk/xstream/src/test/com/thoughtworks/acceptance/SerializationCallbackOrderTest.java?r=797

So can you elaborate more about the circumstances, where this happens for you or - even better - provide a test case?

  • Jörg

Joerg Schaible - 06/Jul/06 03:00 PM
I found a situation, where this could happen. Basically all serializable objects with such a method where affected, that also have an unserializable parent. You might try the latest snapshot for your case and report.