You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2020/01/27 18:42:00 UTC

[jira] [Resolved] (JEXL-322) JXLT String literals cannot contain curly braces

     [ https://issues.apache.org/jira/browse/JEXL-322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro resolved JEXL-322.
--------------------------------
    Resolution: Fixed

Changeset: fc4b5a4d52c68c6f788526983a6df5bdd4f972b0
Author:    henrib <he...@apache.org>
Date:      2020-01-27 19:40
Message:   JEXL-322: read through strings when parsing template exrepssions

> JXLT String literals cannot contain curly braces
> ------------------------------------------------
>
>                 Key: JEXL-322
>                 URL: https://issues.apache.org/jira/browse/JEXL-322
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Constantin Hirsch
>            Assignee: Henri Biestro
>            Priority: Major
>
> 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:
> {code:java}
> new JexlBuilder().create().createJxltEngine()
>     .createTemplate("${\"{\"}").evaluate(new MapContext(), new StringWriter());
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)