You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Constantin Hirsch (Jira)" <ji...@apache.org> on 2020/01/24 11:08:00 UTC
[jira] [Created] (JEXL-322) JXLT String literals cannot contain
curly braces
Constantin Hirsch created JEXL-322:
--------------------------------------
Summary: 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
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)