Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-322

JXLT String literals cannot contain curly braces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None

    Description

      In the TemplateEngine, inside an Inline-Expression, a String literal containing a curly brace leads to a parser error.

       

      To reproduce, just run this code:

      new JexlBuilder().create().createJxltEngine()
          .createTemplate("${\"{\"}").evaluate(new MapContext(), new StringWriter());
      

      The Exception is either "malformed expression" or "tokenization error", depending on if the inner curly brace is opening or closing.

       

      The problem lies in the parsing state machine of TemplateEngine.parseExpression(). It does not recognize the String literal.

      Attachments

        Activity

          People

            henrib Henri Biestro
            constantinhirschsemvox Constantin Hirsch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: