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

thrift writes malformed java codes when generating union with "reuse-objects" option

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.9.3
    • None
    • Java - Compiler
    • None

    Description

      I ran thrfit  command with options "--gen java:reuse-objects" .

      As a result a variable was generated with no initializing.

      There are sample codes bellow.

      I got a compile error that "error: variable put might not have been initialized" 

      // code placeholder
      @Override
       protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
       _Fields setField = _Fields.findByThriftId(field.id);
      if (setField != null) {
      switch (setField) {
      case PUT:
          if (field.type == PUT_FIELD_DESC.type) {
          TPut put;
          if (put == null) {
              put = new TPut();
          }
          put.read(iprot);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dongjin2193 dongjin2193.jeon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: