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

boolean false value cannot be transferred

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.3
    • 0.10.0
    • Lua - Compiler
    • None
    • Linux Windows

    • Patch Available
    • Patch, Important

    Description

      To check element of self whether nil or not,avoid the value(false) of BOOL is lost.

      eg.

      Before
        if self.argBool then
          oprot:writeFieldBegin('argBool', TType.BOOL, 13)
          oprot:writeBool(self.argBool)
          oprot:writeFieldEnd()
        end
      
      After
        if self.argBool ~= nil then
          oprot:writeFieldBegin('argBool', TType.BOOL, 13)
          oprot:writeBool(self.argBool)
          oprot:writeFieldEnd()
        end
      

      Why:
      the value(false) for parameter self.argBool will be lost when condition is 'if self.argBool then' as before.

      Attachments

        Activity

          People

            gityf WangYaofu
            gityf WangYaofu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: