[
https://jira.jboss.org/jira/browse/JASSIST-42?page=com.atlassian.jira.plu...
]
Andrew Dinn commented on JASSIST-42:
------------------------------------
After talking to Chiba I have added one more refinement to this patch to avoid the
backwards compatibility problems. Method ProxyFactory.setHandler() is still retained but
has been deprecated. Existing code which uses the deprecated method will continue to work
as before but classes will not be cached. New code which follows the model for creating
and initialising proxies described in the javadoc for Proxyfactory will automatically
cache and reuse proxy classes.
If ProxyFactory.setHandler() is not called then the factory generates proxy classes
according to the new model. These classes do not install a handler for their instances and
they can be cached and reused safely. The client must use ProxyObject.setHandler() to
configure the handler for each instance.
If the client calls ProxyFactory.setHandler() with a non-null argument the factory
switches to generating proxy classes according to the old model i.e. the classes install
the supplied handler when they create their instances. The factory automatically disables
caching when this method is called.
Note that instances of old style classes can still be serialized/deserialized after this
fix. Furthermore, the patched deserialization code ensures that a new style class is used
(and hence cached and reused) for the deserialized instance, avoiding creation of
unnecessary proxy classes at deserialize.
Proxy serialization looses inner data objects
---------------------------------------------
Key: JASSIST-42
URL:
https://jira.jboss.org/jira/browse/JASSIST-42
Project: Javassist
Issue Type: Bug
Reporter: Damien Lecan
Assignee: Shigeru Chiba
Priority: Blocker
I working with proxies build with ProxyFactory method.
When I want to serialize/deserialize it, everything seems to be ok except that only proxy
instance is serialized, not inner objects.
Eg.
Object "A" contains an instance of "B"
After serialization/deserialization of a proxy of A, instance of "B" in
"A" is null
When I look at this code :
public static SerializedProxy makeSerializedProxy(Object proxy)
throws java.io.InvalidClassException
{
Class clazz = proxy.getClass();
return new SerializedProxy(clazz, ProxyFactory.getFilter(clazz),
ProxyFactory.getHandler(clazz));
}
I don't understand how serialization can keep inner objects ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira