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

    • Sub-task
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.3, 0.4, 0.5
    • 0.6, 0.7
    • Java - Compiler
    • None
    • 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.patch
          6 kB
          Mathias Herberts
        2. thrift-1038-v2.patch
          6 kB
          Bryan Duxbury

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: