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

No Need to Explicitly Print Null

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Java - Compiler
    • None

    Description

      if (!first) sb.append(", ");
       sb.append("i16_list:");
       if (this.i16_list == null) {
       sb.append("null");
       } else {
       sb.append(this.i16_list);
       }
      

      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.

      if the argument is null, then a string equal to "null"; otherwise, the value of obj.toString() is returned.

      So, Thrift doesn't need to manually append 'null' here, can reduce the code here.

      Attachments

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h