[jboss-jira] [JBoss JIRA] (WFLY-4457) EL 3 LambdaExpression failing with an exception irreversibly pollutes variable scope

Tomaz Cerar (JIRA) issues at jboss.org
Tue Mar 24 10:29:20 EDT 2015


     [ https://issues.jboss.org/browse/WFLY-4457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomaz Cerar reassigned WFLY-4457:
---------------------------------

    Assignee: Tomaz Cerar  (was: Jason Greene)


> EL 3 LambdaExpression failing with an exception irreversibly pollutes variable scope
> ------------------------------------------------------------------------------------
>
>                 Key: WFLY-4457
>                 URL: https://issues.jboss.org/browse/WFLY-4457
>             Project: WildFly
>          Issue Type: Bug
>    Affects Versions: 8.2.0.Final
>            Reporter: Paul Pogonyshev
>            Assignee: Tomaz Cerar
>              Labels: el-expresion, patch
>         Attachments: lambda-expression-scoping-fix.diff
>
>
> When a lambda expression is exited with an exception, its variables are left on stack and cannot be removed from it without hacks. My usecase is a customly defined function that uses exceptions as means of non-local exit, but the bug triggers even without custom functions, as demonstrated below.
> Test case:
> {noformat}
>         ELProcessor  processor = new ELProcessor ();
>         processor.defineBean ("x", null);
>         try {
>             processor.eval ("(x -> x.bug ()) ('bug')");
>         }
>         catch (RuntimeException exception) {
>             // This is expected, there is no method bug() on strings.
>         }
>         processor.eval ("x");  // This must evaluate to null, but instead evaluates to "bug".
> {noformat}
> Proposed fix will be attached as a short patch against 'javax/el/LambdaExpression.java'.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list