Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1264

Litmus fail does not interpolate arguments

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: core
    • Labels:
      None

      Description

      Litmus#fail is currently implemented with String.format which does not accept a pair of curly brackets '{}' for formatting variables.
      For example,

      litmus.fail("msg is {}", "some error");
      => "msg is {}"

      I see 2 options:

      1. Change every call to fail that uses {}
      2. fail should use the sl4j MessageFormatter

      I'm going to open a PR with strategy 2. It's nice to keep the same message format as the logger, otherwise it's easy to introduce bugs there. There are currently only 2 places that use the "%s" format to call fail, so those can be easily changed.

        Activity

        Hide
        chris-baynes Chris Baynes added a comment -
        Show
        chris-baynes Chris Baynes added a comment - Here's the PR: https://github.com/apache/calcite/pull/241
        Hide
        julianhyde Julian Hyde added a comment -
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/2f937c1b . Chris Baynes , Thanks for the PR!
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.8.0 (2016-06-13).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.8.0 (2016-06-13).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            chris-baynes Chris Baynes
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development