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

No Need to Explicitly Print Null

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Java - Compiler
    • Labels:
      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

          Activity

            People

            • Assignee:
              belugabehr David Mollitor
              Reporter:
              belugabehr David Mollitor

              Dates

              • Created:
                Updated:

              Time Tracking

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

                Issue deployment