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

Thrift does not pretty print binary typedefs the way it does binary fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.9.3
    • 0.9.3
    • Java - Compiler
    • None

    Description

      The generated Java struct toString uses TBaseHelper.toString to print binary fields but not fields which are typedef binary.

      e.g.

      typedef BinType binary
      struct BinHolder {
       1: binary bin_field
       2: BinType typedef_field
      }
      

      results in

       sb.append("bin_field:");
          if (this.bin_field == null) {
            sb.append("null");
          } else {
            org.apache.thrift.TBaseHelper.toString(this.bin_field, sb);
          }
          first = false;
          if (!first) sb.append(", ");
          sb.append("typedef_field:");
          if (this.typedef_field == null) {
            sb.append("null");
          } else {
            sb.append(this.typedef_field);
          }
      

      Attachments

        Activity

          People

            jensg Jens Geyer
            roshangeorge Roshan George
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: