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

Incorrect skeleton code generated for services that extend another service

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.8
    • None
    • C++ - Compiler
    • None

    Description

      service Calculator extends shared.SharedService {
        void ping(),
        i32 add(1:i32 num1, 2:i32 num2),
        i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch),
        oneway void zip()
      }
      

      which extends

      service SharedService {
       SharedStruct getStruct(1: i32 key)
      }
      

      The generated server skeleton class CalculatorHandler inherits ONLY from CalculatorIf, which correctly inherits from SharedServiceIf, and thus the CalculatorHandler looks like this (less interesting stuff omitted):

      class CalculatorHandler : virtual public CalculatorIf {
      public:
       CalculatorHandler();
      
       void ping();
       int32_t add(const int32_t num1, const int32_t num2);
       int32_t calculate(const int32_t logid, const Work& w);
       void zip();
      };
      

      From my understanding, the class should also implement the getStruct() member. Otherwise the inheritance from SharedService seems not to make much sense. In contrast, the CalculatorNull class inherits the getStruct() member from SharedServiceNull, which is what one would expect.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jensg Jens Geyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: