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"
Description
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"
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.
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.
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?