Roshan George created THRIFT-3098:
-------------------------------------

             Summary: Thrift does not pretty print binary typedefs the way it 
does binary fields
                 Key: THRIFT-3098
                 URL: https://issues.apache.org/jira/browse/THRIFT-3098
             Project: Thrift
          Issue Type: Bug
          Components: Java - Compiler
    Affects Versions: 0.9.3
            Reporter: Roshan George
            Priority: Trivial


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

e.g.
{code}
typedef BinType binary
struct BinHolder {
 1: binary bin_field
 2: BinType typedef_field
}
{code}

results in

{code}
 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);
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to