Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2542

Change diagnostics to use string interpolation

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

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Diagnostics

    Description

      Our various diagnostics use a format string plus varargs to build a message. For example

      this.SDE("Some error message: %s", someArgument)
      

      One downside of this approach is that there is no compile time validation of the format string and arguments. So if the the format strings and args don't match, it can lead to unexpected error messages or runtime errors.

      An alternative approach is to use string interpolation:

      this.SDE(s"Some error message: ${someArgument}")
      

      This completely avoids the possibility of format string/var args missmatch.

      We should go through our diagnostic messages and switch to using string interpolation.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            slawrence Steve Lawrence

            Dates

              Created:
              Updated:

              Slack

                Issue deployment