[
https://issues.apache.org/jira/browse/THRIFT-1038?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mathias Herberts updated THRIFT-1038:
-------------------------------------
Attachment: THRIFT-1038.patch
Adds writeObject/readObject methods.
The Java serialization process uses a standard TSerializer to serialize the
object in a byte array and then write it out on the ObjectOutputStream.
The Java deserialization reads the byte[] from the ObjectInputStream then uses
a TDeserializer to deserialize the object (guessing on the fly the protocol
used for serialization even though it should be TCompactProtocol).
> Generated Java code for structures containing binary fields (or collections
> thereof) are not serializable (in the Java sense) even though they implement
> java.io.Serializable
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-1038
> URL: https://issues.apache.org/jira/browse/THRIFT-1038
> Project: Thrift
> Issue Type: Bug
> Components: Java - Compiler
> Affects Versions: 0.3, 0.4, 0.5
> Environment: All
> Reporter: Mathias Herberts
> Assignee: Mathias Herberts
> Priority: Blocker
> Fix For: 0.6
>
> Attachments: THRIFT-1038.patch
>
>
> Since THRIFT-830, binary fields are implemented using ByteBuffer instead of
> byte[], but ByteBuffer are not serializable (in the Java sense), therefore
> the generated Java classes are not serializable either.
> Even though one might expect the Thrift serialization to be used instead of
> Java serialization, there are situations where the serialization of the
> classes is not in the hands of the user (think for example about the
> HttpSession offline storage done in Tomcat), therefore we MUST generate Java
> classes that are serializable in the Java sense.
> I'm finishing up a compiler patch to generate writeObject/readObject methods
> that will make the generated classes Serializable again, will submit it
> tonight.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.