David Mollitor created THRIFT-5292:
--------------------------------------

             Summary: No Need to Explicitly Print Null
                 Key: THRIFT-5292
                 URL: https://issues.apache.org/jira/browse/THRIFT-5292
             Project: Thrift
          Issue Type: Improvement
            Reporter: David Mollitor


{code:java}
if (!first) sb.append(", ");
 sb.append("i16_list:");
 if (this.i16_list == null) {
 sb.append("null");
 } else {
 sb.append(this.i16_list);
 }
{code}
{quote}The overall effect is exactly as if the argument were converted to a 
string by the method String.valueOf(Object), and the characters of that string 
were then appended to this character sequence.
{quote}
{quote}if the argument is null, then a string equal to "null"; otherwise, the 
value of obj.toString() is returned.
{quote}
So, Thrift doesn't need to manually append 'null' here, can reduce the code 
here.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to