Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-734

Can't use primitive types in service definitions for bean generated code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.3
    • Java - Compiler
    • None

    Description

      I compiled the Cassandra interface using thrift --gen java:beans,hashcode,nocamel. When I call the "insert" method on the Cassandra definition, I get the error:

      Caused by: org.apache.thrift.protocol.TProtocolException: Required field 'timestamp' is unset!

      Timestamp is of type "i64" in the service definition. Since "insert_args" for the insert method is compiled using beans and validation, it is checking the isset bitvector to see if "timestamp" is set.

      However, the insert method doesn't use set_timsetamp and instead says "args.timestamp = timestamp;". This fails to set the isset for timestamp in the bitvector.

      The bug only appears for primitive types because those are the only types that use the isset bitvector.

      Attachments

        1. thrift-734.patch
          1.0 kB
          Bryan Duxbury

        Activity

          People

            bryanduxbury Bryan Duxbury
            marz Nathan Marz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: