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

Generated C++ code only sends the first optional field in the write() function for a struct.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9
    • 0.9
    • C++ - Compiler
    • None
    • Patch Available

    Description

      The generated C++ code for a struct will only write the first optional field that is set before moving on to writing the required fields, instead it should be checking and writing all of the optional fields if they have been set. Looking at the generated code it is doing "if-else" tests for writing each optional field, this limits it to only writing the first optional field it comes across and should be easily fixed by replacing it with "if" checks instead.

      Attachments

        1. THRIFT-1518_fix.patch
          1 kB
          Thomas Wiggins

        Issue Links

          Activity

            People

              tomw Thomas Wiggins
              chris5287 Chris Stylianou
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: