Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1920 Binary Type
  3. THRIFT-1038

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

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.3, 0.4, 0.5
    • Fix Version/s: 0.6, 0.7
    • Component/s: Java - Compiler
    • Labels:
      None
    • Environment:

      All

      Description

      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.

        Attachments

        1. thrift-1038-v2.patch
          6 kB
          Bryan Duxbury
        2. THRIFT-1038.patch
          6 kB
          Mathias Herberts

          Issue Links

            Activity

              People

              • Assignee:
                herberts Mathias Herberts
                Reporter:
                herberts Mathias Herberts
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: