[jira] [Resolved] (JEXL-311) Jxlt template scripts fail using verbatim expressions embedded in lambdas

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (JEXL-311) Jxlt template scripts fail using verbatim expressions embedded in lambdas

Alex D Herbert (Jira)

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

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

Changeset: 9064d425b5e1d3e7cea1f5a6deeeb23effb66c2a
Author:    henrib <[hidden email]>
Date:      2019-08-22 00:04
Message:   JEXL-311: parse verbatim expressions with correct scope, added tests using lambdas

> Jxlt template scripts fail using verbatim expressions embedded in lambdas
> -------------------------------------------------------------------------
>
>                 Key: JEXL-311
>                 URL: https://issues.apache.org/jira/browse/JEXL-311
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Henri Biestro
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> It seems lambdas in template break the template interpreter. Quick analysis shows the jexl namespace is not solved, the symbols are not recognised as such.
> The following test should work. 
> {code:java}
>       @Test
>     public void test311a() throws Exception {
>         JexlContext ctx = null;
>         String rpt
>                 = "$$((a)->{\n"
>                 + "<p>Universe ${a}</p>\n"
>                 + "$$})(42)";
>         JxltEngine.Template t = JXLT.createTemplate("$$", new StringReader(rpt));
>         StringWriter strw = new StringWriter();
>         t.evaluate(ctx, strw);
>         String output = strw.toString();
>         Assert.assertEquals("<p>Universe 42</p>\n", output);
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)